Skip to content

Commit

Permalink
Do not hold lock unnecessarily when hashing (#24815) (#24831)
Browse files Browse the repository at this point in the history
(cherry picked from commit a73f998)

Co-authored-by: Brooks Prumo <brooks@solana.com>
  • Loading branch information
mergify[bot] and brooksprumo authored Apr 29, 2022
1 parent 7e71d87 commit f8b09ff
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 @@ -5798,12 +5798,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 f8b09ff

Please sign in to comment.