Skip to content

Commit

Permalink
Merge #8076: VerifyDB: don't check blocks that have been pruned
Browse files Browse the repository at this point in the history
bd477f4 VerifyDB: don't check blocks that have been pruned (Suhas Daftuar)
  • Loading branch information
sipa authored and sickpig committed Feb 17, 2017
1 parent 628825a commit b7430bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/init.cpp
Expand Up @@ -1307,8 +1307,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)

uiInterface.InitMessage(_("Verifying blocks..."));
if (fHavePruned && GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
LogPrintf("Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n",
MIN_BLOCKS_TO_KEEP, GetArg("-checkblocks", DEFAULT_CHECKBLOCKS));
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks",
MIN_BLOCKS_TO_KEEP);
}

{
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Expand Up @@ -4244,6 +4244,11 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))));
if (pindex->nHeight < chainActive.Height()-nCheckDepth)
break;
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
// If pruning, only go back as far as we have data.
LogPrintf("VerifyDB(): block verification stopping at height %d (pruning, no data)\n", pindex->nHeight);
break;
}
CBlock block;
// check level 0: read from disk
if (!ReadBlockFromDisk(block, pindex, chainparams.GetConsensus()))
Expand Down

0 comments on commit b7430bc

Please sign in to comment.