util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
This commit is contained in:
1 parent
687e655ae2
commit
5b946edd73
1 file changed
+3
-3
+3
-3
@@ -519,12 +519,12 @@ bool ArgsManager::InitSettings(std::string& error)
|
|||||||
|
|
||||||
bool ArgsManager::GetSettingsPath(fs::path* filepath, bool temp) const
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
if (filepath) {
|
if (filepath) {
|
||||||
std::string settings = GetArg("-settings", BITCOIN_SETTINGS_FILENAME);
|
*filepath = fsbridge::AbsPathJoin(GetDataDirNet(), temp ? settings + ".tmp" : settings);
|
||||||
*filepath = fsbridge::AbsPathJoin(GetDataDirNet(), fs::PathFromString(temp ? settings + ".tmp" : settings));
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user