Page MenuHomePhabricator

Remove gArgs global from init
ClosedPublic

Authored by Fabien on Dec 10 2020, 13:50.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC7eba616806bb: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Dec 10 2020, 13:50
deadalnix requested changes to this revision.Dec 10 2020, 15:39
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/bitcoind.cpp
60 ↗(On Diff #26305)

This is duplicated

This revision now requires changes to proceed.Dec 10 2020, 15:39
This revision is now accepted and ready to land.Dec 11 2020, 17:28
This revision was automatically updated to reflect the committed changes.