Transactionpool: Make ready_at return earlier (#8995)

`ready_at` returns when we have processed the requested block. However,
on startup we already have processed the best block and there
are no transactions in the pool on startup anyway. So, we can set `updated_at`
to the best block on startup.

Besides that `ready_at` now returns early when there are no ready nor
any future transactions in the pool.
This commit is contained in:
Bastian Köcher
2021-06-02 20:13:47 +02:00
committed by GitHub
parent 554a0cb274
commit 2ab5f9aeca
2 changed files with 58 additions and 18 deletions
@@ -296,7 +296,13 @@ mod tests {
let client = Arc::new(client);
let spawner = sp_core::testing::TaskExecutor::new();
let pool = Arc::new(BasicPool::with_revalidation_type(
Options::default(), true.into(), api(), None, RevalidationType::Full, spawner.clone(),
Options::default(),
true.into(),
api(),
None,
RevalidationType::Full,
spawner.clone(),
0,
));
let env = ProposerFactory::new(
spawner.clone(),
@@ -373,6 +379,7 @@ mod tests {
None,
RevalidationType::Full,
spawner.clone(),
0,
));
let env = ProposerFactory::new(
spawner.clone(),
@@ -453,6 +460,7 @@ mod tests {
None,
RevalidationType::Full,
spawner.clone(),
0,
));
let env = ProposerFactory::new(
spawner.clone(),