HomePhabricator

Remove gArgs global from init

Description

Remove gArgs global from init

Summary:

The gArgs global has several issues:

    gArgs is used by each process (bitcoind, bitcoin-qt, bitcoin-wallet,
bitcoin-cli, bitcoin-tx, ...), but it is hard to determine which
arguments are actually used by each process. For example arguments that
have never been registered, but are still used, will always return the
fallback value.
    Tests may run several sub-tests, which need different settings. So
globals will have to be overwritten, but that is fragile on its own:
e.g. #19704 (comment) or #19511

The goal is to remove gArgs, but as a first step in that direction this
pull will change gArgs in init to use a passed-in reference instead.

Backport of core PR19779.

Depends on D8644 and D8645.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Aug 21 2020, 18:13
FabienCommitted on Dec 14 2020, 07:41
FabienPushed on Dec 14 2020, 07:43
Reviewer
Restricted Project
Differential Revision
D8646: Remove gArgs global from init
Parents
rABC318eba92a9cf: refactor: Pass ArgsManager into functions that register args
Branches
Unknown
Tags
Unknown