Fix bank hash not changing when no internal state has changed (#7052)
* Fix bank hash not changing when no internal state has changed * Fix unnecessary call to hash_internal_state * Add blockhash into the bank_hash * Add blockhash into the bank_hash and update tests * Refactor accounts_db slot_hashes * More clarity in comments * Add clippy suggestion * Grammar * Fix compile after clippy made me break it * Schooled by clippy
This commit is contained in:
@@ -454,12 +454,7 @@ impl Accounts {
|
||||
|
||||
pub fn hash_internal_state(&self, slot_id: Slot) -> Option<BankHash> {
|
||||
let slot_hashes = self.accounts_db.slot_hashes.read().unwrap();
|
||||
let slot_hash = slot_hashes.get(&slot_id)?;
|
||||
if slot_hash.0 {
|
||||
Some(slot_hash.1)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
slot_hashes.get(&slot_id).cloned()
|
||||
}
|
||||
|
||||
/// This function will prevent multiple threads from modifying the same account state at the
|
||||
|
Reference in New Issue
Block a user