HomePhabricator

Merge #13428: validation: check the specified number of blocks (off-by-one)

Description

Merge #13428: validation: check the specified number of blocks (off-by-one)

Summary:
f6f8026e40326e74293dc8ecc270a7e3b4850727 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

Test Plan:

make check
./bitcoind --printtoconsole
./bitcoin-cli verifychain 3 6

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4103

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Jun 13 2018, 13:42
nakihitoCommitted on Sep 18 2019, 16:03
nakihitoPushed on Sep 18 2019, 16:03
Reviewer
Restricted Owners Package
Differential Revision
D4103: Merge #13428: validation: check the specified number of blocks (off-by-one)
Parents
rABCc023ad5f2890: Merge #12885: Reduce implementation code inside CScript
Branches
Unknown
Tags
Unknown