Skip to content

Commit

Permalink
Revert "core/txpool/legacypool: narrow down the scope of the variable (
Browse files Browse the repository at this point in the history
…ethereum#27471)"

This reverts commit 8a351f6.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent cb29e74 commit 2245710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) {
log.Debug("Skipping deep transaction reorg", "depth", depth)
} else {
// Reorg seems shallow enough to pull in all transactions into memory
var discarded, included types.Transactions
var (
rem = pool.chain.GetBlock(oldHead.Hash(), oldHead.Number.Uint64())
add = pool.chain.GetBlock(newHead.Hash(), newHead.Number.Uint64())
Expand Down Expand Up @@ -1290,7 +1291,6 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) {
log.Warn("New head missing in txpool reset", "number", newHead.Number, "hash", newHead.Hash())
return
}
var discarded, included types.Transactions
for rem.NumberU64() > add.NumberU64() {
discarded = append(discarded, rem.Transactions()...)
if rem = pool.chain.GetBlock(rem.ParentHash(), rem.NumberU64()-1); rem == nil {
Expand Down

0 comments on commit 2245710

Please sign in to comment.