diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-02-09 17:54:49 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-03-02 06:09:27 -0500 |
commit | 5b946edd73640c6ecdfb4cbac1d4351e634678dc (patch) | |
tree | ddbb1bf8953b04eb356bd1af996e5dae6674153c /src/util/system.cpp | |
parent | 687e655ae2970f2f13aca0267c7de86dc69be763 (diff) | |
download | bitcoin-5b946edd73640c6ecdfb4cbac1d4351e634678dc.tar.xz |
util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index af5a511a78..1ad701c56d 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -519,12 +519,12 @@ bool ArgsManager::InitSettings(std::string& error) bool ArgsManager::GetSettingsPath(fs::path* filepath, bool temp) const { - if (IsArgNegated("-settings")) { + fs::path settings = GetPathArg("-settings", fs::path{BITCOIN_SETTINGS_FILENAME}); + if (settings.empty()) { return false; } if (filepath) { - std::string settings = GetArg("-settings", BITCOIN_SETTINGS_FILENAME); - *filepath = fsbridge::AbsPathJoin(GetDataDirNet(), fs::PathFromString(temp ? settings + ".tmp" : settings)); + *filepath = fsbridge::AbsPathJoin(GetDataDirNet(), temp ? settings + ".tmp" : settings); } return true; } |