Passing CChainParams explicitly as parameter when possible facilitates testing and refactoring.
Dependencies:
- Chainparams: Refactor: Decouple IsSuperMajority from Params() #5968
- Chainparams: Remove redundant getter CChainParams::SubsidyHalvingInterval() #5996
- Chainparams: Refactor: Remove redundant HashGenesisBlock() getter #5997
- Chainparams: Refactor: Remove redundant AllowMinDifficultyBlocks() getter #5998
- Cleanup: Delete CChainParams getters to attributes from Consensus::Params #5999
- Chainparams: Explicit CMessageHeader::MessageStartChars to functions in main: #6173
- Chainparams: Explicit Consensus::Params arg for almost all remaining functions #6163
- Globals: Make AcceptBlockHeader static (Fix #6163) (AcceptBlockHeader) #6982
- Globals: Don’t call Params() from miner.cpp #6986 [global-chainparams-miner]
- Blocksize: Turn MAX_BLOCK_SIZE and MAX_BLOCK_SIGOPS into functions #6625
[ ] Chainparams: Explicit Consensus::Params arg in consensus functions #6024- Consensus: Adapt declarations of most obviously consensus functions [closed for now] #6591 [consensus-params-0.12.99]
- Globals: Explicit CChainParams in main.o (not touching the interface with net.o)
- Globals: Explicit CChainParams in net.o (voluntaries required, ideally someone heavily touching net.o for any other reason)
- Globals: Remove SelectParams()
EDIT Initial description:
After the struct Consensus::Params was created in #5812, there are some redundant getters in CChainParams. This depends on all the PRs that help remove them and continues passing CChainParams and Consensus::Params more explicitly, mainly in main.o, miner.o and init.cpp. The rpc’s, net.o, rest.o and base58.o are left with direct Params() calls. In the tests, Params(CBaseChainParams::MAIN) is preferred.