Better surface bank hash verification failures
This commit is contained in:
parent
3db159f616
commit
3ac0192d40
|
@ -375,7 +375,12 @@ impl Accounts {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn verify_bank_hash(&self, slot: Slot, ancestors: &HashMap<Slot, usize>) -> bool {
|
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(
|
pub fn load_by_program(
|
||||||
|
|
|
@ -1071,6 +1071,10 @@ impl AccountsDB {
|
||||||
if calculated_hash == found_hash_info.hash {
|
if calculated_hash == found_hash_info.hash {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
warn!(
|
||||||
|
"mismatched bank hash for slot {}: {} (calculated) != {} (expected)",
|
||||||
|
slot, calculated_hash, found_hash_info.hash
|
||||||
|
);
|
||||||
Err(MismatchedBankHash)
|
Err(MismatchedBankHash)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue