This is a continuation of #7829 by @jtimon
Explicitly pass CChainParams& to LoadBlockIndexDB() and LoadBlockIndex() and removed the Params() global call
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.
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.
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();