ReadBlockFromDisk: do genesis block check before block proof check

This commit is contained in:
Gregory Sanders 2019-05-31 12:04:06 -04:00
parent 6f0d9244f6
commit 0a8565bbf8

View file

@ -1148,8 +1148,8 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus:
// Check the header
const uint256 block_hash = block.GetHash();
if (!CheckProof(block, consensusParams) &&
block_hash != consensusParams.hashGenesisBlock) {
if (block_hash != consensusParams.hashGenesisBlock &&
!CheckProof(block, consensusParams)) {
return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString());
}