Do not hold lock unnecessarily when hashing (#24815)

This commit is contained in:
Brooks Prumo 2022-04-29 03:40:28 -05:00 committed by GitHub
parent a61652104b
commit a73f99823d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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)
}