refactor, consensus: remove calls to global Params() in validation layer#23448
refactor, consensus: remove calls to global Params() in validation layer#23448lsilva01 wants to merge 1 commit intobitcoin:masterfrom
Params() in validation layer#23448Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
stratospher
left a comment
There was a problem hiding this comment.
Concept ACK.
- aac6548
CChainParams m_paramsis made a public member ofclass CChainState.chainstate.m_paramsis used instead of globalParams()in AcceptToMemoryPool in validation.cpp. (with changes in fuzz/tx_pool.cpp done in PR 23465)
- 20df92b
chainstate.m_paramsis used instead of globalParams()in validation.cpp inside functions like ProcessNewPackage(), ProcessNewBlockHeaders(), LoadMempool() and PopulateAndValidateSnapshot().- The function signature of
LoadBlockIndexDB()is changed to include the first argument asConsensus::Paramsand call site updated in order to avoid the global call to Params() within the function.
I'm also curious to know if there's any added advantage in making m_params public (in comparison with using getters/setters)?
20df92b to
8d44624
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
@lsilva01 are you still interested in working on this? |
|
Pretty sure this is already done in master? |
This PR removes calls to global
Params()in validation layer (except in theCChainStateconstructor).Motivation: Reducing the use of global variables makes code more predictable.
Requires #23437 as it changes the visibility of
CChainState::m_paramsto public.