Fix stopatheight #10569

pull achow101 wants to merge 1 commits into bitcoin:master from achow101:fix-stopatheight changing 1 files +3 −3
  1. achow101 commented at 6:54 PM on June 9, 2017: member

    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)

  2. luke-jr approved
  3. luke-jr commented at 7:22 PM on June 9, 2017: member

    utACK

  4. in src/validation.cpp:2347 in 54a36856c5 outdated
    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);
    


    sipa commented at 7:34 PM on June 9, 2017:

    Can you move this line out of the loop? No need to parse the command line argument for every block.

  5. luke-jr commented at 8:34 PM on June 9, 2017: member

    What's up with the random optimisation?

  6. achow101 force-pushed on Jun 9, 2017
  7. Fix stopatheight
    Moves stopatheight check into the ActivateBestChain loop so that the block height is actually checked and stopped at the appropriate time.
    c45cbaf69f
  8. achow101 force-pushed on Jun 9, 2017
  9. achow101 commented at 8:41 PM on June 9, 2017: member

    sorry, checked out from the wrong worktree

  10. sipa commented at 11:04 PM on June 9, 2017: member

    utACK c45cbaf69f4fe6c8dabd48205da3bf302ed99c8a

  11. fanquake added the label Validation on Jun 9, 2017
  12. paveljanik commented at 6:13 AM on June 10, 2017: contributor

    utACK c45cbaf

  13. laanwj commented at 12:02 PM on June 11, 2017: member

    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.

  14. laanwj merged this on Jun 11, 2017
  15. laanwj closed this on Jun 11, 2017

  16. laanwj referenced this in commit 2e7d8f8b7d on Jun 11, 2017
  17. achow101 deleted the branch on Jun 12, 2017
  18. luke-jr referenced this in commit 33fbec103b on Jun 15, 2017
  19. PastaPastaPasta referenced this in commit a2efc33525 on Jul 5, 2019
  20. PastaPastaPasta referenced this in commit 92b95a3ff4 on Jul 5, 2019
  21. PastaPastaPasta referenced this in commit dbb738c91f on Jul 6, 2019
  22. PastaPastaPasta referenced this in commit 94ead666a1 on Jul 8, 2019
  23. PastaPastaPasta referenced this in commit 2bfa374729 on Jul 8, 2019
  24. barrystyle referenced this in commit 1dea31b651 on Jan 22, 2020
  25. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me