feat(txpool): add IntoIterator for AllPoolTransactions (#21241)

This commit is contained in:
Matthias Seitz
2026-01-21 11:01:32 +01:00
committed by GitHub
parent 8a8a9126d6
commit 5a5c21cc1b

View File

@@ -746,6 +746,18 @@ impl<T: PoolTransaction> Default for AllPoolTransactions<T> {
}
}
impl<T: PoolTransaction> IntoIterator for AllPoolTransactions<T> {
type Item = Arc<ValidPoolTransaction<T>>;
type IntoIter = std::iter::Chain<
std::vec::IntoIter<Arc<ValidPoolTransaction<T>>>,
std::vec::IntoIter<Arc<ValidPoolTransaction<T>>>,
>;
fn into_iter(self) -> Self::IntoIter {
self.pending.into_iter().chain(self.queued)
}
}
/// Represents transactions that were propagated over the network.
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct PropagatedTransactions(pub HashMap<TxHash, Vec<PropagateKind>>);