Skip to content

Commit

Permalink
tx-pool: add all method for AllPoolTransactions (paradigmxyz#12643)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Nov 19, 2024
1 parent 496bf0b commit 206ba29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ impl<T: PoolTransaction> AllPoolTransactions<T> {
pub fn queued_recovered(&self) -> impl Iterator<Item = T::Consensus> + '_ {
self.queued.iter().map(|tx| tx.transaction.clone().into())
}

/// Returns an iterator over all transactions, both pending and queued.
pub fn all(&self) -> impl Iterator<Item = T::Consensus> + '_ {
self.pending.iter().chain(self.queued.iter()).map(|tx| tx.transaction.clone().into())
}
}

impl<T: PoolTransaction> Default for AllPoolTransactions<T> {
Expand Down

0 comments on commit 206ba29

Please sign in to comment.