Skip to content

Commit 615da97

Browse files
committed
util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
1 parent 3206d1a commit 615da97

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
@@ -518,12 +518,12 @@ bool ArgsManager::InitSettings(std::string& error)
518518

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

0 commit comments

Comments
 (0)