From 0ac5a342869e932041ff95d9573bba209c61410e Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Sat, 21 Dec 2024 11:07:32 +0100 Subject: [PATCH] fix: release mutex sooner --- crates/amaru/src/consensus/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/amaru/src/consensus/mod.rs b/crates/amaru/src/consensus/mod.rs index 3201c02..2e9b100 100644 --- a/crates/amaru/src/consensus/mod.rs +++ b/crates/amaru/src/consensus/mod.rs @@ -94,6 +94,9 @@ impl gasket::framework::Worker for Worker { let ledger = stage.ledger.lock().await; assert_header(&header, &stage.epoch_to_nonce, &*ledger)?; + // Make sure the Mutex is released as soon as possible + drop(ledger); + let block = { let mut peer_session = stage.peer_session.lock().await; let client = (*peer_session).blockfetch();