Skip to content

Commit

Permalink
fix: fix setTxContext index
Browse files Browse the repository at this point in the history
  • Loading branch information
Lredhdx committed Dec 26, 2024
1 parent bc0cd43 commit 9a3cc41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions miner/worker_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ func (w *worker) simulateBundle(
)

succeedTxs := types.Transactions{}
for i, tx := range bundle.Txs {
state.SetTxContext(tx.Hash(), i+currentTxCount)
succeedTxCount := 0
for _, tx := range bundle.Txs {
state.SetTxContext(tx.Hash(), succeedTxCount+currentTxCount)

snap := state.Snapshot()
gp := gasPool.Gas()
Expand Down Expand Up @@ -427,6 +428,7 @@ func (w *worker) simulateBundle(
bundleGasFees.Add(bundleGasFees, txGasFees)
}
succeedTxs = append(succeedTxs, tx)
succeedTxCount++
}

// prune bundle when all txs are dropped
Expand Down

0 comments on commit 9a3cc41

Please sign in to comment.