Browse Source

Remove unnecessary consistency checks

As per https://github.com/zcash/zcash/issues/6532 this should speed up
startup times by roughly 3X and drastically reduce disk i/o on startup.
pull/332/head
Duke 1 year ago
parent
commit
cf1274a42a
  1. 3
      src/txdb.cpp

3
src/txdb.cpp

@ -737,6 +737,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
//fprintf(stderr,"loadguts ht.%d\n",pindexNew->GetHeight());
// Consistency checks
/*
CBlockHeader header;
{
LOCK(cs_main);
@ -753,6 +754,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
if (header.GetHash() != pindexNew->GetBlockHash())
return error("LoadBlockIndex(): block header inconsistency detected: on-disk = %s, in-memory = %s",
diskindex.ToString(), pindexNew->ToString());
if ( 0 ) // POW will be checked before any block is connected
{
uint8_t pubkey33[33];
@ -760,6 +762,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
if (!CheckProofOfWork(header,pubkey33,pindexNew->GetHeight(),Params().GetConsensus()))
return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
}
*/
pcursor->Next();
} else {
return error("LoadBlockIndex() : failed to read value");

Loading…
Cancel
Save