Log failing block hash

Log failing block hash if an attempt is made to connect a corrupt block.
This commit is contained in:
Ross Nicoll 2021-06-21 21:23:36 +01:00
parent 25dada932a
commit d5446c1a27
No known key found for this signature in database
GPG key ID: E679E30C312B94E0

View file

@ -1782,6 +1782,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
// GetAdjustedTime() to go backward).
if (!CheckBlock(block, state, !fJustCheck, !fJustCheck)) {
if (state.CorruptionPossible()) {
LogPrintf("%s: Attempt to connect corrupted block %s.\n", __func__, block.GetHash().ToString());
// We don't write down blocks to disk if they may have been
// corrupted, so this should be impossible unless we're having hardware
// problems.