good morning!!!!

Skip to content
Snippets Groups Projects
Commit 1d2ebeb9 authored by Ferran Borreguero's avatar Ferran Borreguero
Browse files

Fix memory leak in txpool

parent 3283fb9a
No related branches found
No related tags found
No related merge requests found
......@@ -1173,9 +1173,15 @@ 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))) {
// london fork enabled, reset given the base fee
pendingBaseFee := misc.CalcBaseFee(pool.chainconfig, reset.newHead)
pool.priced.SetBaseFee(pendingBaseFee)
} else {
// london fork not enabled, reheap to "reset" the priced list
pool.priced.Reheap()
}
}
}
// Ensure pool.queue and pool.pending sizes stay within the configured limits.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment