chore: dont use tmp lock vars (#10092)

This commit is contained in:
Matthias Seitz
2024-08-05 18:26:23 +02:00
committed by GitHub
parent e1406d62ce
commit 735738dfff

View File

@ -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 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;