Trivial: Explicitly pass const CChainParams& to LoadBlockIndexDB() #9013

pull gtsui wants to merge 1 commits into bitcoin:master from gtsui:global-params-cleanup changing 3 files +5 −6
  1. gtsui commented at 2:44 pm on October 25, 2016: contributor

    This is a continuation of #7829 by @jtimon

    Explicitly pass CChainParams& to LoadBlockIndexDB() and LoadBlockIndex() and removed the Params() global call

  2. Explicitly pass const CChainParams& to LoadBlockIndexDB() d0b01f3a85
  3. jtimon commented at 3:22 pm on October 25, 2016: contributor

    Hi @gtsui welcome to the project! Please tell me if you have any problems with this or other related PRs and I will try to help you Everything seems perfectly correct with this PR.

    utACK (stands for “untested ACK”, see https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#peer-review )

    The only thing that I have to add is that there was some recent talk about replacing the checkpoints as a mechanism for guessing the verification progress. If that change were made, then LoadBlockIndexDB() and LoadBlockIndex() could take only a const Consensus::Params& instead of the full const CChainParams&. I hope that’s not a blocker for this, but if it is, it should be easy for you to rebase and adapt it that change is merged.

  4. laanwj added the label Refactoring on Oct 26, 2016
  5. laanwj commented at 12:26 pm on October 28, 2016: member

    utACK https://github.com/bitcoin/bitcoin/pull/9013/commits/d0b01f3a859eacc51a28fc18d2ed7e361ec90833

    Sure, in the future this could probably be reduced in scope to a ConsensusParams, but passing the entire chainparams doesn’t hurt and changing the parameter would be a low-priority change afterward.

  6. TheBlueMatt commented at 5:11 pm on October 28, 2016: member
    utACK d0b01f3a859eacc51a28fc18d2ed7e361ec90833
  7. in src/main.cpp: in d0b01f3a85
    3965@@ -3966,9 +3966,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
    3966     return pindexNew;
    3967 }
    3968 
    3969-bool static LoadBlockIndexDB()
    3970+bool static LoadBlockIndexDB(const CChainParams& chainparams)
    3971 {
    3972-    const CChainParams& chainparams = Params();
    


    rebroad commented at 3:52 am on October 29, 2016:
    What is Params() anyway?

  8. laanwj merged this on Nov 2, 2016
  9. laanwj closed this on Nov 2, 2016

  10. laanwj referenced this in commit c05db83488 on Nov 2, 2016
  11. codablock referenced this in commit 0ca63c42d8 on Sep 19, 2017
  12. codablock referenced this in commit 2999d097f6 on Jan 13, 2018
  13. andvgal referenced this in commit 9a4c8220f0 on Jan 6, 2019
  14. CryptoCentric referenced this in commit f33462eda0 on Feb 15, 2019
  15. CryptoCentric referenced this in commit d89f807da7 on Feb 15, 2019
  16. 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-11-17 18:12 UTC

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