HomePhabricator

Deduplicate settings merge code

Description

Deduplicate settings merge code

Summary:
Get rid of settings merging code in util/system.cpp repeated 5 places,
inconsistently:

  • ArgsManagerHelper::GetArg
  • ArgsManagerHelper::GetNetBoolArg
  • ArgsManager::GetArgs
  • ArgsManager::IsArgNegated
  • ArgsManager::GetUnsuitableSectionOnlyArgs

Having settings merging code separated from parsing simplifies parsing somewhat
(for example negated values can simply be represented as false values instead
of partially cleared or emply placeholder lists).

Having settings merge happen one place instead of 5 makes it easier to add new
settings sources and harder to introduce new inconsistencies in the way
settings are merged.

This commit does not change behavior in any way.

This is a partial backport of Core PR15934 : https://github.com/bitcoin/bitcoin/pull/15934/commits/7f40528cd50fc43ac0bd3e785de24d661adddb7a

This PR had to be modified due to ClearForcedArg and ForceSetMultiArg not being supported by Core.

Depends on D5905

Test Plan:

make check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Apr 22 2019, 22:08
deadalnixCommitted on Apr 30 2020, 16:00
deadalnixPushed on Apr 30 2020, 16:00
Reviewer
Restricted Project
Differential Revision
D5903: Deduplicate settings merge code
Parents
rABC0a6446292453: Remove includeconf nested scope
Branches
Unknown
Tags
Unknown