mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
refactor(tx-pool): small refactor (#12107)
This commit is contained in:
@@ -575,7 +575,7 @@ where
|
||||
// Filter out errors
|
||||
<P::Transaction as PoolTransaction>::try_from_consensus(tx.into()).ok()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
.collect();
|
||||
|
||||
let outcome = pool.add_transactions(crate::TransactionOrigin::Local, pool_transactions).await;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ impl<T: TransactionOrdering> Iterator for BestTransactions<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A[`BestTransactions`](crate::traits::BestTransactions) implementation that filters the
|
||||
/// A [`BestTransactions`](crate::traits::BestTransactions) implementation that filters the
|
||||
/// transactions of iter with predicate.
|
||||
///
|
||||
/// Filter out transactions are marked as invalid:
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::{
|
||||
|
||||
/// A set of validated blob transactions in the pool that are __not pending__.
|
||||
///
|
||||
/// The purpose of this pool is keep track of blob transactions that are queued and to evict the
|
||||
/// The purpose of this pool is to keep track of blob transactions that are queued and to evict the
|
||||
/// worst blob transactions once the sub-pool is full.
|
||||
///
|
||||
/// This expects that certain constraints are met:
|
||||
@@ -198,14 +198,13 @@ impl<T: PoolTransaction> BlobTransactions<T> {
|
||||
&mut self,
|
||||
pending_fees: &PendingFees,
|
||||
) -> Vec<Arc<ValidPoolTransaction<T>>> {
|
||||
let to_remove = self.satisfy_pending_fee_ids(pending_fees);
|
||||
let removed = self
|
||||
.satisfy_pending_fee_ids(pending_fees)
|
||||
.into_iter()
|
||||
.map(|id| self.remove_transaction(&id).expect("transaction exists"))
|
||||
.collect();
|
||||
|
||||
let mut removed = Vec::with_capacity(to_remove.len());
|
||||
for id in to_remove {
|
||||
removed.push(self.remove_transaction(&id).expect("transaction exists"));
|
||||
}
|
||||
|
||||
// set pending fees and reprioritize / resort
|
||||
// Update pending fees and reprioritize
|
||||
self.pending_fees = pending_fees.clone();
|
||||
self.reprioritize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user