Quickly skip invalid transactions during block authorship. (#9789)

* Support skipping invalid transactions in the iterator.

* Expose concrete iterator.

* cargo +nightly fmt --all

* More consistent placement.

* Update Cargo.lock

* Pass transaction to 'report_invalid'
This commit is contained in:
Tomasz Drwięga
2021-10-01 16:25:13 +02:00
committed by GitHub
parent 29ff036463
commit 085935dd0a
8 changed files with 159 additions and 71 deletions
@@ -36,7 +36,7 @@ use sp_runtime::{
use super::{
future::{FutureTransactions, WaitingTransaction},
ready::ReadyTransactions,
ready::{BestIterator, ReadyTransactions},
};
/// Successful import result.
@@ -355,7 +355,7 @@ impl<Hash: hash::Hash + Member + Serialize, Ex: std::fmt::Debug> BasePool<Hash,
}
/// Returns an iterator over ready transactions in the pool.
pub fn ready(&self) -> impl Iterator<Item = Arc<Transaction<Hash, Ex>>> {
pub fn ready(&self) -> BestIterator<Hash, Ex> {
self.ready.get()
}