Skip to content

Commit caabdea

Browse files
committed
Merge #13428: validation: check the specified number of blocks (off-by-one)
f6f8026 validation: check the specified number of blocks (off-by-one) (Karl-Johan Alm) Pull request description: ``` echeveria | 2018-06-11 02:03:03.384975 Verifying last 3 blocks at level 3 echeveria | 2018-06-11 02:03:23.676793 No coin database inconsistencies in last 4 blocks (6564 transactions) echeveria | off by one? sipa | echeveria: possibly! kallewoof | Looks like it checks one more block than suggested. `if (pindex->nHeight < chainActive.Height()-nCheckDepth) break;` should probably be `<=`. sipa | kallewoof: agree ``` Post-commit: ``` 2018-06-11T05:24:02Z Verifying last 6 blocks at level 3 2018-06-11T05:24:02Z [0%]...[16%]...[33%]...[50%]...[66%]...[83%]...[99%]...[DONE]. 2018-06-11T05:25:07Z No coin database inconsistencies in last 6 blocks (7258 transactions) ``` Pre-commit: ``` 2018-06-11T05:27:11Z Verifying last 6 blocks at level 3 2018-06-11T05:27:11Z [0%]...[16%]...[33%]...[50%]...[66%]...[83%]...[99%]...[DONE]. 2018-06-11T05:27:12Z No coin database inconsistencies in last 7 blocks (9832 transactions) ``` Tree-SHA512: 6e68dc4ba74232518c2ba8ea624d65893534f3619d43ccdf0b9c65992f25b68cb52cf54fa35e6e3d092d1eee5c9a8887057828895f1acdafc0ebb48f683fffdc
2 parents 4b1edd3 + f6f8026 commit caabdea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
40004000
reportDone = percentageDone/10;
40014001
}
40024002
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, false);
4003-
if (pindex->nHeight < chainActive.Height()-nCheckDepth)
4003+
if (pindex->nHeight <= chainActive.Height()-nCheckDepth)
40044004
break;
40054005
if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
40064006
// If pruning, only go back as far as we have data.

0 commit comments

Comments
 (0)