diff --git a/crates/transaction-pool/src/pool/mod.rs b/crates/transaction-pool/src/pool/mod.rs index 1878242eee..19faa29c36 100644 --- a/crates/transaction-pool/src/pool/mod.rs +++ b/crates/transaction-pool/src/pool/mod.rs @@ -600,19 +600,15 @@ where /// Notifies transaction listeners about changes once a block was processed. fn notify_on_new_state(&self, outcome: OnNewCanonicalStateOutcome) { // 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 hashes + self.pending_transaction_listener + .lock() + .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 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;