From 2b1c6f85fcd0a0b5fe637cc8b4cd7d8130f2ab71 Mon Sep 17 00:00:00 2001 From: Jin Date: Fri, 16 Jun 2023 07:30:15 +0800 Subject: [PATCH] txpool:reheap the priced list if london fork not enabled --- core/txpool/txpool.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index 1395725402603..cbe9ae4436e86 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -1208,9 +1208,13 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt // because of another transaction (e.g. higher gas price). if reset != nil { pool.demoteUnexecutables() - if reset.newHead != nil && pool.chainconfig.IsLondon(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) { - pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead) - pool.priced.SetBaseFee(pendingBaseFee) + if reset.newHead != nil { + if pool.chainconfig.IsLondon(new(big.Int).Add(reset.newHead.Number, big.NewInt(1))) { + pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead) + pool.priced.SetBaseFee(pendingBaseFee) + } else { + pool.priced.Reheap() + } } // Update all accounts to the latest known pending nonce nonces := make(map[common.Address]uint64, len(pool.pending))