aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromanornr <romanornr@gmail.com>2017-07-08 18:44:03 +0200
committerromanornr <romanornr@gmail.com>2017-07-08 19:49:11 +0200
commitd9d1bd3267cf0f9fc6f56250bd8cd3af7596c11e (patch)
treef73b938f34145b32b020285e27698b1977d0d2c6
parent1d4805ce04645f3203b0cfd3d66ea710e7433eb4 (diff)
nCheckDepth chain height fix
-rw-r--r--src/validation.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 09288be1ca..4831e819d7 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3577,9 +3577,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
return true;
// Verify blocks in the best chain
- if (nCheckDepth <= 0)
- nCheckDepth = 1000000000; // suffices until the year 19000
- if (nCheckDepth > chainActive.Height())
+ if (nCheckDepth <= 0 || nCheckDepth > chainActive.Height())
nCheckDepth = chainActive.Height();
nCheckLevel = std::max(0, std::min(4, nCheckLevel));
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);