Better surface bank hash verification failures

This commit is contained in:
Michael Vines 2020-02-05 10:21:19 -07:00
parent 3db159f616
commit 3ac0192d40
2 changed files with 10 additions and 1 deletions

View File

@ -375,7 +375,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

@ -1071,6 +1071,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 {