HomePhabricator

validation: access chainparams via chainstatemanager

Description

validation: access chainparams via chainstatemanager

Summary:

validation: replace ::Params() calls with chainstate/chainman member

refactor: Replace Chainstate::m_params with chainman.GetParams()

kernel: pass params to BlockManager rather than using a global

After these 3 commits, there is no more validation code using the global getter for the global CChainParams.

The chainparams are now accessed either:

  • via a Config passed as a function argument
  • via ChainstateManager::GetParams (uses ChainstateManager::m_config::GetChainParams())
  • a chainparams function argument

This is a backport of core#25264, core#25830, core#24595

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15037

Details

Provenance
PiRKAuthored on Dec 22 2023, 12:21
PiRKPushed on Dec 25 2023, 09:37
Reviewer
Restricted Project
Differential Revision
D15037: validation: access chainparams via chainstatemanager
Parents
rABC3fe6ce71ad7a: use static constexpr and braced initialization in policy.h
Branches
Unknown
Tags
Unknown