Skip to content

Commit

Permalink
add synchronization comment to handle_new_root (solana-labs#19571)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbiseda authored and jeffwashington committed Sep 2, 2021
1 parent 6c409f8 commit 8bf0e5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,8 @@ impl ReplayStage {
accounts_background_request_sender,
highest_confirmed_root,
);
// Dropping the bank_forks write lock and reacquiring as a read lock is
// safe because updates to bank_forks are only made by a single thread.
let r_bank_forks = bank_forks.read().unwrap();
let new_root_bank = &r_bank_forks[new_root];
if !*has_new_vote_been_rooted {
Expand Down

0 comments on commit 8bf0e5a

Please sign in to comment.