Better surface bank hash verification failures (#8134)

automerge
This commit is contained in:
mergify[bot]
2020-02-05 12:04:34 -08:00
committed by GitHub
parent bea34a812c
commit 1cae9fd893
2 changed files with 10 additions and 1 deletions

View File

@ -370,7 +370,12 @@ impl Accounts {
}
pub fn verify_bank_hash(&self, slot: Slot, ancestors: &HashMap<Slot, usize>) -> bool {
self.accounts_db.verify_bank_hash(slot, ancestors).is_ok()
if let Err(err) = self.accounts_db.verify_bank_hash(slot, ancestors) {
warn!("verify_bank_hash failed: {:?}", err);
false
} else {
true
}
}
pub fn load_by_program(

View File

@ -1065,6 +1065,10 @@ impl AccountsDB {
if calculated_hash == found_hash_info.hash {
Ok(())
} else {
warn!(
"mismatched bank hash for slot {}: {} (calculated) != {} (expected)",
slot, calculated_hash, found_hash_info.hash
);
Err(MismatchedBankHash)
}
} else {