diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2023-02-27 14:21:13 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2023-02-27 14:21:13 -0500 |
commit | 9a9d5da11fa6033f82dcf8e2298aee29587f5396 (patch) | |
tree | cbc98608c2d6791b8d8b7cf38e9c3ce81a6b2422 /src/util/system.h | |
parent | b20b34f5b33230fe253c81008496bd9b13fd6ecf (diff) |
refactor: Stop using gArgs global in system.cpp
Most of the code in util/system.cpp that was hardcoded to use the global
ArgsManager instance `gArgs` has been changed to work with explicit ArgsManager
instances (for example in https://github.com/bitcoin/bitcoin/pull/20092). But a
few hardcoded references to `gArgs` remain. This commit removes the last ones
so these functions aren't reading or writing global state.
Diffstat (limited to 'src/util/system.h')
-rw-r--r-- | src/util/system.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/system.h b/src/util/system.h index 14f093501a..8d4bedeb36 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -33,6 +33,7 @@ #include <utility> #include <vector> +class ArgsManager; class UniValue; // Application startup time (used for uptime calculation) @@ -96,8 +97,8 @@ void ReleaseDirectoryLocks(); bool TryCreateDirectories(const fs::path& p); fs::path GetDefaultDataDir(); // Return true if -datadir option points to a valid directory or is not specified. -bool CheckDataDirOption(); -fs::path GetConfigFile(const fs::path& configuration_file_path); +bool CheckDataDirOption(const ArgsManager& args); +fs::path GetConfigFile(const ArgsManager& args, const fs::path& configuration_file_path); #ifdef WIN32 fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif @@ -112,11 +113,12 @@ void runCommand(const std::string& strCommand); * Most paths passed as configuration arguments are treated as relative to * the datadir if they are not absolute. * + * @param args Parsed arguments and settings. * @param path The path to be conditionally prefixed with datadir. * @param net_specific Use network specific datadir variant * @return The normalized path. */ -fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific = true); +fs::path AbsPathForConfigVal(const ArgsManager& args, const fs::path& path, bool net_specific = true); inline bool IsSwitchChar(char c) { |