diff options
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 76d63074e4..5b87806a45 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -386,7 +386,7 @@ std::optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) co return std::nullopt; } -const fs::path& ArgsManager::GetBlocksDirPath() +const fs::path& ArgsManager::GetBlocksDirPath() const { LOCK(cs_args); fs::path& path = m_cached_blocks_path; @@ -402,7 +402,7 @@ const fs::path& ArgsManager::GetBlocksDirPath() return path; } } else { - path = GetDataDirPath(false); + path = GetDataDirBase(); } path /= BaseParams().DataDir(); @@ -412,7 +412,7 @@ const fs::path& ArgsManager::GetBlocksDirPath() return path; } -const fs::path& ArgsManager::GetDataDirPath(bool net_specific) const +const fs::path& ArgsManager::GetDataDir(bool net_specific) const { LOCK(cs_args); fs::path& path = net_specific ? m_cached_network_datadir_path : m_cached_datadir_path; @@ -511,7 +511,7 @@ bool ArgsManager::GetSettingsPath(fs::path* filepath, bool temp) const } if (filepath) { std::string settings = GetArg("-settings", BITCOIN_SETTINGS_FILENAME); - *filepath = fsbridge::AbsPathJoin(GetDataDirPath(/* net_specific= */ true), temp ? settings + ".tmp" : settings); + *filepath = fsbridge::AbsPathJoin(GetDataDirNet(), temp ? settings + ".tmp" : settings); } return true; } @@ -800,11 +800,6 @@ fs::path GetDefaultDataDir() #endif } -const fs::path &GetDataDir(bool fNetSpecific) -{ - return gArgs.GetDataDirPath(fNetSpecific); -} - bool CheckDataDirOption() { std::string datadir = gArgs.GetArg("-datadir", ""); @@ -1359,7 +1354,7 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific) if (path.is_absolute()) { return path; } - return fsbridge::AbsPathJoin(GetDataDir(net_specific), path); + return fsbridge::AbsPathJoin(net_specific ? gArgs.GetDataDirNet() : gArgs.GetDataDirBase(), path); } void ScheduleBatchPriority() |