Skip to content

Commit

Permalink
Only build if constraints are present
Browse files Browse the repository at this point in the history
  • Loading branch information
benhenryhunter committed Nov 13, 2024
1 parent 40e997e commit 68212fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ func (w *worker) fillTransactionsSelectAlgo(interrupt *atomic.Int32, env *enviro
if len(constraints) > 0 {
blockBundles, allBundles, mempoolTxHashes, err = w.fillTransactions(interrupt, env, constraints)
} else {
blockBundles, allBundles, usedSbundles, mempoolTxHashes, err = w.fillTransactionsAlgoWorker(interrupt, env)
return nil, nil, nil, nil, errors.New("constraints are empty")
}

return blockBundles, allBundles, usedSbundles, mempoolTxHashes, err
Expand Down Expand Up @@ -1453,6 +1453,7 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment, con

signerAndNonceOfConstraints[from] = tx.Nonce()
}

for sender, lazyTxs := range pendingPlainTxs {
common.Filter(&lazyTxs, func(lazyTx *txpool.LazyTransaction) bool {
if nonce, ok := signerAndNonceOfConstraints[sender]; ok {
Expand Down

0 comments on commit 68212fd

Please sign in to comment.