Skip to content

Commit

Permalink
Only check 1 in 1000 block header sigs on load
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Mar 27, 2019
1 parent 87c06d4 commit 0baa135
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/txdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams,
pindexNew->nTx = diskindex.nTx;

const uint256 block_hash = pindexNew->GetBlockHash();
if (!CheckProof(pindexNew->GetBlockHeader(), consensusParams) &&
// Only validate one of every 1000 block header for sanity check
if (pindexNew->nHeight % 1000 == 0 &&
!CheckProof(pindexNew->GetBlockHeader(), consensusParams) &&
block_hash != consensusParams.hashGenesisBlock) {
return error("%s: CheckProof: %s, %s", __func__, block_hash.ToString(), pindexNew->ToString());
}
Expand Down

0 comments on commit 0baa135

Please sign in to comment.