HomePhabricator

refactor, txdb: Use DBParams struct in CBlockTreeDB

Description

refactor, txdb: Use DBParams struct in CBlockTreeDB

Summary:
PR rationale:

Code in the libbitcoin_kernel library should not be calling ArgsManager methods or trying to read options from the command line. Instead it should just get options values from simple structs and function arguments that are passed in externally. This PR removes gArgs accesses from dbwrapper and txdb modules by defining appropriate options structs.

Use DBParams struct to remove ArgsManager uses from txdb.

To reduce size of this commit, this moves references to gArgs variable out of
txdb.cpp to calling code in chainstate.cpp. But these moves are temporary. The
gArgs references in chainstate.cpp are moved out to calling code in init.cpp in
later commits.

This commit does not change behavior.

This is a partial backport of core#25862
https://github.com/bitcoin/bitcoin/pull/25862/commits/0352258148c51572426666d337c7b28d0033376c

Depends on D16092

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Aug 17 2022, 03:32
PiRKCommitted on May 3 2024, 08:34
PiRKPushed on May 3 2024, 08:34
Reviewer
Restricted Project
Differential Revision
D16093: refactor, txdb: Use DBParams struct in CBlockTreeDB
Parents
rABC788e09ea04bf: refactor, txdb: Add CoinsViewOptions struct
Branches
Unknown
Tags
Unknown