Print bank hash and hash inputs. (#7733) (#7734)

automerge
This commit is contained in:
mergify[bot]
2020-01-09 17:13:31 -08:00
committed by Grimes
parent 9c9a690d0d
commit 2509002fe4
2 changed files with 11 additions and 3 deletions

View File

@@ -1615,12 +1615,21 @@ impl Bank {
let accounts_delta_hash = self.rc.accounts.bank_hash_at(self.slot());
let mut signature_count_buf = [0u8; 8];
LittleEndian::write_u64(&mut signature_count_buf[..], self.signature_count() as u64);
hashv(&[
let hash = hashv(&[
self.parent_hash.as_ref(),
accounts_delta_hash.as_ref(),
&signature_count_buf,
self.last_blockhash().as_ref(),
])
]);
info!(
"bank frozen: {} hash: {} accounts_delta: {} signature_count: {} last_blockhash: {}",
self.slot(),
hash,
accounts_delta_hash,
self.signature_count(),
self.last_blockhash()
);
hash
}
/// Recalculate the hash_internal_state from the account stores. Would be used to verify a