fix: remove popped tx from total set (#4599)

This commit is contained in:
Matthias Seitz
2023-09-14 15:40:46 +02:00
committed by GitHub
parent 09b5f1012c
commit 3d564aa393

View File

@ -637,9 +637,17 @@ impl<T: TransactionOrdering> TxPool<T> {
.$limit
.is_exceeded($this.$pool.len(), $this.$pool.size())
{
// pops the worst transaction from the sub-pool
if let Some(tx) = $this.$pool.pop_worst() {
let id = tx.transaction_id;
// now that the tx is removed from the sub-pool, we need to remove it also from the total set
$this.all_transactions.remove_transaction(&id);
// record the removed transaction
removed.push(tx);
// this might have introduced a nonce gap, so we also discard any descendants
$this.remove_descendants(&id, &mut $removed);
}
}