mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
This commit is contained in:
parent
687e655ae2
commit
5b946edd73
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue