Skip to content

Commit 5b946ed

Browse files
committed
util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
1 parent 687e655 commit 5b946ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/util/system.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,12 @@ bool ArgsManager::InitSettings(std::string& error)
519519

520520
bool ArgsManager::GetSettingsPath(fs::path* filepath, bool temp) const
521521
{
522-
if (IsArgNegated("-settings")) {
522+
fs::path settings = GetPathArg("-settings", fs::path{BITCOIN_SETTINGS_FILENAME});
523+
if (settings.empty()) {
523524
return false;
524525
}
525526
if (filepath) {
526-
std::string settings = GetArg("-settings", BITCOIN_SETTINGS_FILENAME);
527-
*filepath = fsbridge::AbsPathJoin(GetDataDirNet(), fs::PathFromString(temp ? settings + ".tmp" : settings));
527+
*filepath = fsbridge::AbsPathJoin(GetDataDirNet(), temp ? settings + ".tmp" : settings);
528528
}
529529
return true;
530530
}

0 commit comments

Comments
 (0)