Skip to content

Commit

Permalink
chore: dont use tmp lock vars (#10092)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Aug 5, 2024
1 parent e1406d6 commit 735738d
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions crates/transaction-pool/src/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,19 +600,15 @@ where
/// Notifies transaction listeners about changes once a block was processed.
fn notify_on_new_state(&self, outcome: OnNewCanonicalStateOutcome<T::Transaction>) {
// notify about promoted pending transactions
{
// emit hashes
let mut transaction_hash_listeners = self.pending_transaction_listener.lock();
transaction_hash_listeners.retain_mut(|listener| {
listener.send_all(outcome.pending_transactions(listener.kind))
});

// emit full transactions
let mut transaction_full_listeners = self.transaction_listener.lock();
transaction_full_listeners.retain_mut(|listener| {
listener.send_all(outcome.full_pending_transactions(listener.kind))
})
}
// emit hashes
self.pending_transaction_listener
.lock()
.retain_mut(|listener| listener.send_all(outcome.pending_transactions(listener.kind)));

// emit full transactions
self.transaction_listener.lock().retain_mut(|listener| {
listener.send_all(outcome.full_pending_transactions(listener.kind))
});

let OnNewCanonicalStateOutcome { mined, promoted, discarded, block_hash } = outcome;

Expand Down

0 comments on commit 735738d

Please sign in to comment.