From 29e11ad5488f3675a54e8a588de2cf01b91e8a67 Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Wed, 10 Sep 2025 11:33:38 +0200 Subject: [PATCH] core/txpool/legacypool: fix bug --- core/txpool/legacypool/list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/txpool/legacypool/list.go b/core/txpool/legacypool/list.go index bf92d8d58e..0c9f13c62f 100644 --- a/core/txpool/legacypool/list.go +++ b/core/txpool/legacypool/list.go @@ -336,7 +336,9 @@ func (l *list) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Transa l.totalcost = total // Old is being replaced, subtract old cost - l.subTotalCost([]*types.Transaction{old}) + if old != nil { + l.subTotalCost([]*types.Transaction{old}) + } // Otherwise overwrite the old transaction with the current one l.txs.Put(tx)