Globals: Remove a bunch of Params() from main.cpp before 0.12 #7053

pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:globals-chainparams-main changing 5 files +44 −49
  1. jtimon commented at 11:51 am on November 18, 2015: contributor

    This the last part of #5970 that is going to be opened independently, see more details for why in #5970 (comment).

    The main remaining commit in that #5970 was https://github.com/jtimon/bitcoin/commit/8550a273ad04c0b1d1eb518574d85f2e7fba1287 which is lazily leveraging not only previous steps in that PR, but also in the additional work by many people accepting that, given that they were altering the declaration of a function, it was free for them to pass Consensus::Params or CChainParams too. This PR contains that commit plus a few small additions ready to squash or leave out.

    It may be disruptive to things we would really like to see in 0.12 before the testing window closes, but I can easily rebase this on demand, even after all the desired changes are merged and right before forking 0.12 (and I believe it will remain pretty reviewable and low risk). It is likely that after rebase, this becomes more incomplete than it currently is, but better is better.

  2. dcousens commented at 12:12 pm on November 18, 2015: contributor
    utACK
  3. jtimon force-pushed on Nov 18, 2015
  4. btcdrak commented at 3:12 pm on November 18, 2015: contributor
    utACK
  5. laanwj added the label Refactoring on Nov 19, 2015
  6. in src/main.cpp: in 5aa4a0da62 outdated
    3041@@ -3041,13 +3042,13 @@ void UnlinkPrunedFiles(std::set<int>& setFilesToPrune)
    3042 }
    3043 
    3044 /* Calculate the block/rev files that should be deleted to remain under target*/
    3045-void FindFilesToPrune(std::set<int>& setFilesToPrune)
    3046+void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight)
    


    petertodd commented at 9:55 pm on November 20, 2015:
    Nit: I think it’d make more sense if FindFilesToPrune() took a params object, as the PruneAfterHeight feels like an implementation specific detail that FlushStateToDisk() doesn’t need to know about.

    jtimon commented at 9:14 am on November 21, 2015:
    It seems to me that nPruneAfterHeight is precisely the only “implementation detail” from CChainParams that FlushStateToDisk() needs to know about.

    petertodd commented at 9:20 pm on November 22, 2015:

    Right now it is, but my point is the fact that it is is an implementation detail that may change in the future!

    But anyway, that’s a pretty minor nit.


    jtimon commented at 11:12 am on November 23, 2015:
    I’m not sure it was a good idea to put nPruneAfterHeight in CChainParams in the first place. In any case, for functions that only take one thing from CChainParams (not Consensus::Params) I prefer to use the single thing directly instead of the full CChainParams, and if FlushStateToDisk ever needs more things from CChainParams, he can change the function prototype himself. See #6173 for example. So I’m going to leave it as is and squash.
  7. petertodd commented at 9:56 pm on November 20, 2015: contributor
    utACK
  8. Globals: Remove a bunch of Params() calls from main.cpp:
    1) Chainparams: Explicit CChainParams arg for main:
    
    -AcceptBlock
    -AcceptBlockHeader
    -ActivateBestChain
    -ConnectTip
    -InitBlockIndex
    -LoadExternalBlockFile
    -VerifyDB parametric constructor
    
    2) Also pickup more Params()\. in main.cpp
    
    3) Pass nPruneAfterHeight explicitly to new FindFilesToPrune() in main.cpp
    2e29e7e247
  9. jtimon force-pushed on Nov 23, 2015
  10. jtimon commented at 11:15 am on November 23, 2015: contributor
    Squashed
  11. laanwj added this to the milestone 0.12.0 on Nov 24, 2015
  12. MarcoFalke commented at 8:20 am on November 27, 2015: member
    utACK
  13. laanwj merged this on Nov 27, 2015
  14. laanwj closed this on Nov 27, 2015

  15. laanwj referenced this in commit 5ca149a3db on Nov 27, 2015
  16. jtimon referenced this in commit 2c9f73aead on Nov 27, 2015
  17. jtimon referenced this in commit 4d42f6d06b on Nov 27, 2015
  18. jtimon referenced this in commit cb491e7788 on Nov 29, 2015
  19. laanwj referenced this in commit 74b5ce24c6 on Nov 30, 2015
  20. zkbot referenced this in commit 6dcc7dd6ce on Mar 9, 2018
  21. zkbot referenced this in commit b094b02c0b on Mar 10, 2018
  22. zkbot referenced this in commit 59ef0e4c9c on Mar 12, 2018
  23. zkbot referenced this in commit 6dfd4baa1a on Mar 12, 2018
  24. zkbot referenced this in commit 05132fdca8 on Apr 6, 2018
  25. zkbot referenced this in commit 5fefc451a7 on Apr 13, 2018
  26. zkbot referenced this in commit 4c91fbf1c7 on May 31, 2018
  27. zkbot referenced this in commit 82d64f57c9 on Oct 24, 2018
  28. zkbot referenced this in commit 971f37e510 on Oct 25, 2018
  29. zkbot referenced this in commit 5b8b057c96 on Apr 5, 2019
  30. zkbot referenced this in commit a53fd12544 on Apr 9, 2019
  31. zkbot referenced this in commit fcf551eaaf on May 24, 2019
  32. zkbot referenced this in commit e25cb39033 on May 24, 2019
  33. zkbot referenced this in commit 3d37ebe9d8 on May 28, 2019
  34. 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: 2024-10-04 22:12 UTC

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