|
|
|
@ -1121,7 +1121,13 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus:
@@ -1121,7 +1121,13 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus:
|
|
|
|
|
|
|
|
|
|
bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams) |
|
|
|
|
{ |
|
|
|
|
if (!ReadBlockFromDisk(block, pindex->GetBlockPos(), consensusParams)) |
|
|
|
|
CDiskBlockPos blockPos; |
|
|
|
|
{ |
|
|
|
|
LOCK(cs_main); |
|
|
|
|
blockPos = pindex->GetBlockPos(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!ReadBlockFromDisk(block, blockPos, consensusParams)) |
|
|
|
|
return false; |
|
|
|
|
if (block.GetHash() != pindex->GetBlockHash()) |
|
|
|
|
return error("ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index for %s at %s", |
|
|
|
|