Skip to content

Commit

Permalink
VerifyQueue: notify other worker when OnlySmallCycleTx received a lar…
Browse files Browse the repository at this point in the history
…ge cycle tx
  • Loading branch information
eval-exec committed Aug 15, 2024
1 parent 1d27c02 commit 28f21d5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tx-pool/src/verify_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,21 @@ impl Worker {
if self.tasks.read().await.is_empty() {
return;
}

// pick a entry to run verify
let entry = match self
.tasks
.write()
.await
.pop_front(self.role == WorkerRole::OnlySmallCycleTx)
{
Some(entry) => entry,
None => return,
let entry = {
let mut tasks = self.tasks.write().await;
match tasks.pop_front(self.role == WorkerRole::OnlySmallCycleTx) {
Some(entry) => entry,
None => {
tasks.ready_rx.notify_one();
debug!(
"Worker (role: {:?}) queue is empty after pop_front, notify others now",
self.role
);
return;
}
}
};

if let Some((res, snapshot)) = self
Expand Down

0 comments on commit 28f21d5

Please sign in to comment.