mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin#24266: Avoid buggy std::filesystem:::create_directories() call
This commit is contained in:
parent
b02d5e34ff
commit
f4b896ef5f
@ -463,14 +463,18 @@ const fs::path& ArgsManager::GetDataDir(bool net_specific) const
|
||||
} else {
|
||||
path = GetDefaultDataDir();
|
||||
}
|
||||
if (net_specific)
|
||||
path /= fs::PathFromString(BaseParams().DataDir());
|
||||
|
||||
if (fs::create_directories(path)) {
|
||||
// This is the first run, create wallets subdirectory too
|
||||
if (!fs::exists(path)) {
|
||||
fs::create_directories(path / "wallets");
|
||||
}
|
||||
|
||||
if (net_specific && !BaseParams().DataDir().empty()) {
|
||||
path /= fs::PathFromString(BaseParams().DataDir());
|
||||
if (!fs::exists(path)) {
|
||||
fs::create_directories(path / "wallets");
|
||||
}
|
||||
}
|
||||
|
||||
path = StripRedundantLastElementsOfPath(path);
|
||||
return path;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user