HomePhabricator

refactor, dbwrapper: Add DBParams and DBOptions structs

Description

refactor, dbwrapper: Add DBParams and DBOptions structs

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.

Add DBParams and DBOptions structs to remove ArgsManager uses from dbwrapper.

To reduce size of this commit, this moves references to gArgs variable out of
dbwrapper.cpp to calling code in txdb.cpp. But these moves are temporary. The
gArgs references in txdb.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/2eaeded37f3a07c35eef38d9a80c1e5fbd4d41ee

Depends on D16099

Test Plan:
with bitcoin-chainstate compiling enabled:
ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

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
D16091: refactor, dbwrapper: Add DBParams and DBOptions structs
Parents
rABCb4054a5c21a9: coinstats: Split node/coinstats.h to kernel/coinstats.h
Branches
Unknown
Tags
Unknown