Skip to content

Commit

Permalink
Merge pull request #43 from jeluard/jeluard/release-mutex
Browse files Browse the repository at this point in the history
fix: release mutex sooner
  • Loading branch information
abailly authored Dec 28, 2024
2 parents 85016df + 0ac5a34 commit ec6a608
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 ec6a608

Please sign in to comment.