Skip to content

Commit

Permalink
fix: release mutex sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Dec 21, 2024
1 parent 89e18eb commit 0ac5a34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/amaru/src/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ impl gasket::framework::Worker<Stage> 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();
Expand Down

0 comments on commit 0ac5a34

Please sign in to comment.