Check Equihash solution when loading block index
This commit is contained in:
parent
d4d2844829
commit
44488400c1
|
@ -313,6 +313,9 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
||||||
pindexNew->nTx = diskindex.nTx;
|
pindexNew->nTx = diskindex.nTx;
|
||||||
pindexNew->nSproutValue = diskindex.nSproutValue;
|
pindexNew->nSproutValue = diskindex.nSproutValue;
|
||||||
|
|
||||||
|
auto header = pindexNew->GetBlockHeader();
|
||||||
|
if (!CheckEquihashSolution(&header, Params()))
|
||||||
|
return error("LoadBlockIndex(): CheckEquihashSolution failed: %s", pindexNew->ToString());
|
||||||
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus()))
|
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus()))
|
||||||
return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
|
return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue