Make max tip age an option instead of chainparam #7208

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2015_12_maxtipage changing 5 files +9 −6
  1. laanwj commented at 12:30 PM on December 14, 2015: member

    After discussion in #7164 I think this is better.

    Max tip age was introduced in #5987 to make it possible to run testnet-in-a-box. But associating this behavior with the testnet chain is wrong conceptually, as it is not needed in normal usage. Should aim to make testnet test the software as-is.

    Replace it with a (debug) option -maxtipage, which can be specified only in the specific case.

  2. Make max tip age an option instead of chainparam
    After discussion in #7164 I think this is better.
    
    Max tip age was introduced in #5987 to make it possible to run
    testnet-in-a-box. But associating this behavior with the testnet chain
    is wrong conceptually, as it is not needed in normal usage.
    Should aim to make testnet test the software as-is.
    
    Replace it with a (debug) option `-maxtipage`, which can be
    specified only in the specific case.
    64360f1304
  3. laanwj added the label Tests on Dec 14, 2015
  4. paveljanik commented at 7:06 PM on December 14, 2015: contributor

    ACK

  5. dcousens commented at 11:31 PM on December 14, 2015: contributor

    concept ACK, utACK 64360f1

  6. MarcoFalke commented at 4:51 PM on December 17, 2015: member

    utACK 64360f1

  7. in src/init.cpp:None in 64360f1304
     994 | @@ -994,6 +995,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
     995 |      if (GetBoolArg("-peerbloomfilters", true))
     996 |          nLocalServices |= NODE_BLOOM;
     997 |  
     998 | +    nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
    


    jtimon commented at 7:36 PM on January 3, 2016:

    minor nit, maybe

    nMaxTipAge = GetArg("-maxtipage", nMaxTipAge);
    

    to not use DEFAULT_MAX_TIP_AGE twice (nMaxTipAge is already initialized to DEFAULT_MAX_TIP_AGE in main.cpp, this seems a little bit redundant)? Anyway, minor minor minor style nit. Feel more than free to ignore.


    laanwj commented at 10:54 AM on January 18, 2016:

    I've always tried to avoid using the current value as default anywhere for GetArg. Specifying DEFAULT_MAX_TIP_AGE is more clear when reading the code, and when at some point argument parsing is refactored it's nice to have the defaults on hand without having to 'reason back' about the value.


    MarcoFalke commented at 10:58 AM on January 18, 2016:

    @jtimon We use the DEFAULT_* values to make it easier to implement #1044.


    jtimon commented at 10:56 AM on January 19, 2016:

    It's fine, as said it was a very minor nit. Maybe we can remove the redundant initialization in main.cpp? Whatever we do, I'm fine, as long as we try to be consistent among all the globals (which imo should be in globals/server.o of something of the short instead of main chainparams, etc [globals/common.o could take the globals in unit.o and basechainparams, for example]; but one step a a time...).

  8. jtimon commented at 7:41 PM on January 3, 2016: contributor

    utACK https://github.com/laanwj/bitcoin/commit/64360f13044125fbb3cdcbe2e5e8f2bfb82a8b27 There's definitely way too many things in chainparams that shouldn't be there. Ping @luke-jr

  9. luke-jr commented at 1:29 AM on January 10, 2016: member

    Concept ACK. Do any RPC tests need this set for them?

  10. MarcoFalke commented at 2:33 PM on January 10, 2016: member

    Extended tests seem to pass.

  11. laanwj commented at 10:55 AM on January 18, 2016: member

    Concept ACK. Do any RPC tests need this set for them?

    I don't think this is used by any RPC tests. This was introduced because of testnet-in-a-box, which we don't use for RPC tests. @MarcoFalke's test seems to confirm this.

  12. laanwj merged this on Jan 18, 2016
  13. laanwj closed this on Jan 18, 2016

  14. laanwj referenced this in commit 47c5ed19f3 on Jan 18, 2016
  15. codablock referenced this in commit 46e3321aa0 on Sep 16, 2017
  16. codablock referenced this in commit 61b6b57143 on Sep 19, 2017
  17. codablock referenced this in commit 9b548dc5bb on Dec 9, 2017
  18. codablock referenced this in commit 2474fd0aea on Dec 9, 2017
  19. zkbot referenced this in commit ebd25d1744 on Jul 16, 2018
  20. zkbot referenced this in commit 6d605ffbbe on Jul 17, 2018
  21. zkbot referenced this in commit 3835cbb57f on Jul 17, 2018
  22. furszy referenced this in commit b2aecd58a3 on Jun 15, 2019
  23. furszy referenced this in commit 46ba7a2b96 on Jun 15, 2019
  24. Fuzzbawls referenced this in commit 988b33dab8 on Jun 17, 2019
  25. CaveSpectre11 referenced this in commit 389e920d65 on Jun 18, 2019
  26. StompStream referenced this in commit 809a902037 on Jun 19, 2019
  27. FornaxA referenced this in commit 91ae7095e4 on Jul 6, 2020
  28. KolbyML referenced this in commit d2facca17a on Nov 21, 2020
  29. cryptolinux referenced this in commit ad2c832f8b on Feb 6, 2021
  30. ckti referenced this in commit a467ad983a on Mar 29, 2021
  31. MarcoFalke 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-13 15:15 UTC

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