HomePhabricator

Add BlockManagerOpts::chainparams reference

Description

Add BlockManagerOpts::chainparams reference

Summary:
and use it in blockstorage.cpp

PR rationale:

Seems confusing to pass chainparams to each method individually, when the params can't change anyway for the whole lifetime of the block manager, and also must be equal to the ones used by the chainstate manager.

Fix this issue by removing them from the methods and instead storing a reference once in a member field.

This is a partial backport of core#27570
https://github.com/bitcoin/bitcoin/pull/27570/commits/facdb8b331da17c10b122deb28f6d71d5797f063
(partial) https://github.com/bitcoin/bitcoin/pull/27570/commits/fa5d7c39eb992467e43b12db213b27913374fb83

Depends on D16010

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>Authored on May 4 2023, 10:19
PiRKCommitted on Apr 19 2024, 06:04
PiRKPushed on Apr 19 2024, 06:04
Reviewer
Restricted Project
Differential Revision
D16015: Add BlockManagerOpts::chainparams reference
Parents
rABC4fad52ef8211: refactor: Add and use PRUNE_TARGET_MANUAL constexpr
Branches
Unknown
Tags
Unknown