Skip to content

Commit

Permalink
Do not hold lock unnecessarily when hashing (solana-labs#24815)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Apr 29, 2022
1 parent a616521 commit a73f998
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6203,12 +6203,12 @@ impl Bank {
self.last_blockhash().as_ref(),
]);

if let Some(buf) = self
let buf = self
.hard_forks
.read()
.unwrap()
.get_hash_data(self.slot(), self.parent_slot())
{
.get_hash_data(self.slot(), self.parent_slot());
if let Some(buf) = buf {
info!("hard fork at bank {}", self.slot());
hash = extend_and_hash(&hash, &buf)
}
Expand Down

0 comments on commit a73f998

Please sign in to comment.