feat: enforce txpool propagation setting (#3677)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
lukebrich.eth
2023-07-10 06:12:45 -04:00
committed by GitHub
parent d35531e79e
commit 93a6ff98aa
2 changed files with 3 additions and 2 deletions

View File

@@ -232,13 +232,13 @@ where
/// Returns hashes of _all_ transactions in the pool.
pub(crate) fn pooled_transactions_hashes(&self) -> Vec<TxHash> {
let pool = self.pool.read();
pool.all().hashes_iter().collect()
pool.all().transactions_iter().filter(|tx| tx.propagate).map(|tx| *tx.hash()).collect()
}
/// Returns _all_ transactions in the pool.
pub(crate) fn pooled_transactions(&self) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
let pool = self.pool.read();
pool.all().transactions_iter().collect()
pool.all().transactions_iter().filter(|tx| tx.propagate).collect()
}
/// Updates the entire pool after a new block was executed.

View File

@@ -637,6 +637,7 @@ impl<T: PoolTransaction> AllTransactions<T> {
}
/// Returns an iterator over all _unique_ hashes in the pool
#[allow(unused)]
pub(crate) fn hashes_iter(&self) -> impl Iterator<Item = TxHash> + '_ {
self.by_hash.keys().copied()
}