Skip to content

Commit

Permalink
util: Do not use gArgs global in ArgsManager member functions
Browse files Browse the repository at this point in the history
Summary: This is a backport of [[bitcoin/bitcoin#20092 | core#20092]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D10429
  • Loading branch information
hebasto authored and PiRK committed Nov 3, 2021
1 parent de3ebfa commit 1b705e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ void ArgsManager::ClearForcedArg(const std::string &strArg) {
}

std::string ArgsManager::GetHelpMessage() const {
const bool show_debug = gArgs.GetBoolArg("-help-debug", false);
const bool show_debug = GetBoolArg("-help-debug", false);

std::string usage = "";
LOCK(cs_args);
Expand Down Expand Up @@ -1015,7 +1015,7 @@ bool ArgsManager::ReadConfigFiles(std::string &error,
ClearDatadirCache();
if (!CheckDataDirOption()) {
error = strprintf("specified data directory \"%s\" does not exist.",
gArgs.GetArg("-datadir", "").c_str());
GetArg("-datadir", "").c_str());
return false;
}
return true;
Expand Down

0 comments on commit 1b705e9

Please sign in to comment.