mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-26 15:48:13 -05:00
perf: inline pooled transactions max (#12805)
This commit is contained in:
@@ -409,7 +409,7 @@ where
|
||||
&self,
|
||||
max: usize,
|
||||
) -> Vec<Arc<ValidPoolTransaction<Self::Transaction>>> {
|
||||
self.pooled_transactions().into_iter().take(max).collect()
|
||||
self.pool.pooled_transactions_max(max)
|
||||
}
|
||||
|
||||
fn get_pooled_transaction_elements(
|
||||
|
||||
@@ -304,6 +304,14 @@ where
|
||||
self.get_pool_data().all().transactions_iter().filter(|tx| tx.propagate).collect()
|
||||
}
|
||||
|
||||
/// Returns only the first `max` transactions in the pool.
|
||||
pub(crate) fn pooled_transactions_max(
|
||||
&self,
|
||||
max: usize,
|
||||
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
|
||||
self.get_pool_data().all().transactions_iter().filter(|tx| tx.propagate).take(max).collect()
|
||||
}
|
||||
|
||||
/// Returns the [`BlobTransaction`] for the given transaction if the sidecar exists.
|
||||
///
|
||||
/// Caution: this assumes the given transaction is eip-4844
|
||||
|
||||
Reference in New Issue
Block a user