mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: remove popped tx from total set (#4599)
This commit is contained in:
@ -637,9 +637,17 @@ impl<T: TransactionOrdering> TxPool<T> {
|
|||||||
.$limit
|
.$limit
|
||||||
.is_exceeded($this.$pool.len(), $this.$pool.size())
|
.is_exceeded($this.$pool.len(), $this.$pool.size())
|
||||||
{
|
{
|
||||||
|
// pops the worst transaction from the sub-pool
|
||||||
if let Some(tx) = $this.$pool.pop_worst() {
|
if let Some(tx) = $this.$pool.pop_worst() {
|
||||||
let id = tx.transaction_id;
|
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);
|
removed.push(tx);
|
||||||
|
|
||||||
|
// this might have introduced a nonce gap, so we also discard any descendants
|
||||||
$this.remove_descendants(&id, &mut $removed);
|
$this.remove_descendants(&id, &mut $removed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user