aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2016-05-25 16:28:12 +0200
committerPieter Wuille <[email protected]>2016-05-25 16:28:22 +0200
commitd72098038f3b55a714ed8adb34fab547b15eb0d5 (patch)
tree1cc4af14da0e218a8a57ef0def9f8ccade55a1d1 /src/main.cpp
parentMerge #8063: Acquire lock to check for genesis block. (diff)
parentVerifyDB: don't check blocks that have been pruned (diff)
downloaddiscoin-d72098038f3b55a714ed8adb34fab547b15eb0d5.tar.xz
discoin-d72098038f3b55a714ed8adb34fab547b15eb0d5.zip
Merge #8076: VerifyDB: don't check blocks that have been pruned
bd477f4 VerifyDB: don't check blocks that have been pruned (Suhas Daftuar)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9ba90b4ea..33abf3957 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3871,6 +3871,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()))