Skip to content

Commit d9d1bd3

Browse files
committed
nCheckDepth chain height fix
1 parent 1d4805c commit d9d1bd3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/validation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,9 +3577,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
35773577
return true;
35783578

35793579
// Verify blocks in the best chain
3580-
if (nCheckDepth <= 0)
3581-
nCheckDepth = 1000000000; // suffices until the year 19000
3582-
if (nCheckDepth > chainActive.Height())
3580+
if (nCheckDepth <= 0 || nCheckDepth > chainActive.Height())
35833581
nCheckDepth = chainActive.Height();
35843582
nCheckLevel = std::max(0, std::min(4, nCheckLevel));
35853583
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel);

0 commit comments

Comments
 (0)