Skip to content

Commit

Permalink
core: fix double-readlock in validator (solana-labs#26053)
Browse files Browse the repository at this point in the history
  • Loading branch information
BurtonQin authored Jun 20, 2022
1 parent 95ea506 commit 611d2ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,12 @@ impl Validator {
};

let mut block_commitment_cache = BlockCommitmentCache::default();
let bank_forks_guard = bank_forks.read().unwrap();
block_commitment_cache.initialize_slots(
bank_forks.read().unwrap().working_bank().slot(),
bank_forks.read().unwrap().root(),
bank_forks_guard.working_bank().slot(),
bank_forks_guard.root(),
);
drop(bank_forks_guard);
let block_commitment_cache = Arc::new(RwLock::new(block_commitment_cache));

let optimistically_confirmed_bank =
Expand Down

0 comments on commit 611d2ec

Please sign in to comment.