Changeset View
Changeset View
Standalone View
Standalone View
src/blockencodings.cpp
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | ReadStatus PartiallyDownloadedBlock::FillBlock( | ||||
CValidationState state; | CValidationState state; | ||||
if (!CheckBlock(block, state, config->GetChainParams().GetConsensus(), | if (!CheckBlock(block, state, config->GetChainParams().GetConsensus(), | ||||
BlockValidationOptions(*config))) { | BlockValidationOptions(*config))) { | ||||
// TODO: We really want to just check merkle tree manually here, but | // TODO: We really want to just check merkle tree manually here, but | ||||
// that is expensive, and CheckBlock caches a block's "checked-status" | // that is expensive, and CheckBlock caches a block's "checked-status" | ||||
// (in the CBlock?). CBlock should be able to check its own merkle root | // (in the CBlock?). CBlock should be able to check its own merkle root | ||||
// and cache that check. | // and cache that check. | ||||
if (state.CorruptionPossible()) { | if (state.GetReason() == ValidationInvalidReason::BLOCK_MUTATED) { | ||||
// Possible Short ID collision. | // Possible Short ID collision. | ||||
return READ_STATUS_FAILED; | return READ_STATUS_FAILED; | ||||
} | } | ||||
return READ_STATUS_CHECKBLOCK_FAILED; | return READ_STATUS_CHECKBLOCK_FAILED; | ||||
} | } | ||||
LogPrint(BCLog::CMPCTBLOCK, | LogPrint(BCLog::CMPCTBLOCK, | ||||
"Successfully reconstructed block %s with %lu txn prefilled, %lu " | "Successfully reconstructed block %s with %lu txn prefilled, %lu " | ||||
Show All 14 Lines |