From 239738be198850ff5e36b854d0131ce0aa7e2fc4 Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Tue, 9 Sep 2025 14:45:31 +0200 Subject: [PATCH] core/txpool: apply diff --- core/txpool/legacypool/list.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/txpool/legacypool/list.go b/core/txpool/legacypool/list.go index e5c48d538d..bf92d8d58e 100644 --- a/core/txpool/legacypool/list.go +++ b/core/txpool/legacypool/list.go @@ -323,8 +323,6 @@ func (l *list) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Transa if tx.GasFeeCapIntCmp(thresholdFeeCap) < 0 || tx.GasTipCapIntCmp(thresholdTip) < 0 { return false, nil } - // Old is being replaced, subtract old cost - l.subTotalCost([]*types.Transaction{old}) } // Add new tx cost to totalcost cost, overflow := uint256.FromBig(tx.Cost()) @@ -337,6 +335,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}) + // Otherwise overwrite the old transaction with the current one l.txs.Put(tx) if l.costcap.Cmp(cost) < 0 {