Moves stopatheight check into the ActivateBestChain loop so that the block height is actually checked and stopped at the appropriate time.
Noticed and reported here: #10339 (comment)
Moves stopatheight check into the ActivateBestChain loop so that the block height is actually checked and stopped at the appropriate time.
Noticed and reported here: #10339 (comment)
utACK
2342 | @@ -2343,6 +2343,9 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, 2343 | if (pindexFork != pindexNewTip) { 2344 | uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip); 2345 | } 2346 | + 2347 | + int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
Can you move this line out of the loop? No need to parse the command line argument for every block.
What's up with the random optimisation?
Moves stopatheight check into the ActivateBestChain loop so that the block height is actually checked and stopped at the appropriate time.
sorry, checked out from the wrong worktree
utACK c45cbaf69f4fe6c8dabd48205da3bf302ed99c8a
utACK c45cbaf
I thought I was doing something wrong :$ Thanks for fixing this. Tested ACK c45cbaf
$ src/bitcoind -datadir=/store/tmp/testbtc -reindex-chainstate -stopatheight=200000 -printtoconsole
2017-06-11 12:00:02 UpdateTip: new best=000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf height=200000 version=0x00000002 log2_work=68.741562 tx=7316696 date='2012-09-22 10:45:59' progress=0.032039 cache=359.0MiB(2636343txo)
...
2017-06-11 12:00:18 Shutdown: done
As stopatheight is not in any releases this doesn't need backport.