diff --git a/txpool/pool.go b/txpool/pool.go index 9e95db5d4..d6af12da5 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -997,7 +997,7 @@ func onNewTxs(tx kv.Tx, senders *SendersCache, newTxs TxSlots, protocolBaseFee, if err != nil { return err } - onSenderChange(id, sender, byNonce, protocolBaseFee, pendingBaseFee) + onSenderChange(id, sender, byNonce, protocolBaseFee, pendingBaseFee, discard) } pending.EnforceInvariants() @@ -1367,7 +1367,7 @@ func onNewBlock(tx kv.Tx, senders *SendersCache, unwindTxs TxSlots, minedTxs []* if err != nil { return err } - onSenderChange(id, sender, byNonce, protocolBaseFee, pendingBaseFee) + onSenderChange(id, sender, byNonce, protocolBaseFee, pendingBaseFee, discard) } pending.EnforceInvariants() @@ -1505,7 +1505,7 @@ func unsafeAddToPendingPool(byNonce *ByNonce, newTxs TxSlots, pending, baseFee, return changedSenders } -func onSenderChange(senderID uint64, sender *senderInfo, byNonce *ByNonce, protocolBaseFee, pendingBaseFee uint64) { +func onSenderChange(senderID uint64, sender *senderInfo, byNonce *ByNonce, protocolBaseFee, pendingBaseFee uint64, discard func(*metaTx)) { if ASSERT && sender == nil { fmt.Printf("nil sender info: %d\n", senderID) } @@ -1535,6 +1535,7 @@ func onSenderChange(senderID uint64, sender *senderInfo, byNonce *ByNonce, proto mt.subPool |= EnoughFeeCapProtocol } else { mt.subPool = 0 // TODO: we immediately drop all transactions if they have no first bit - then maybe we don't need this bit at all? And don't add such transactions to queue? + discard(mt) return true }