From cf1274a42a7e2416d4958f91238edcb9cfcd3817 Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 20 Apr 2023 04:47:20 -0700 Subject: [PATCH] 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. --- src/txdb.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/txdb.cpp b/src/txdb.cpp index 602987412..22b70f5d5 100644 --- a/src/txdb.cpp +++ b/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");