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)