mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Use ArgsManager::GetPathArg() for "-datadir" option
This commit is contained in:
@@ -440,9 +440,9 @@ const fs::path& ArgsManager::GetDataDir(bool net_specific) const
|
||||
// this function
|
||||
if (!path.empty()) return path;
|
||||
|
||||
std::string datadir = GetArg("-datadir", "");
|
||||
const fs::path datadir{GetPathArg("-datadir")};
|
||||
if (!datadir.empty()) {
|
||||
path = fs::absolute(StripRedundantLastElementsOfPath(fs::PathFromString(datadir)));
|
||||
path = fs::absolute(datadir);
|
||||
if (!fs::is_directory(path)) {
|
||||
path = "";
|
||||
return path;
|
||||
@@ -823,8 +823,8 @@ fs::path GetDefaultDataDir()
|
||||
|
||||
bool CheckDataDirOption()
|
||||
{
|
||||
std::string datadir = gArgs.GetArg("-datadir", "");
|
||||
return datadir.empty() || fs::is_directory(fs::absolute(fs::PathFromString(datadir)));
|
||||
const fs::path datadir{gArgs.GetPathArg("-datadir")};
|
||||
return datadir.empty() || fs::is_directory(fs::absolute(datadir));
|
||||
}
|
||||
|
||||
fs::path GetConfigFile(const std::string& confPath)
|
||||
|
||||
Reference in New Issue
Block a user