File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -245,19 +245,6 @@ static std::optional<util::SettingsValue> InterpretValue(const KeyInfo& key, con
245245 return value;
246246}
247247
248- namespace {
249- fs::path StripRedundantLastElementsOfPath (const fs::path& path)
250- {
251- auto result = path;
252- while (result.filename ().empty () || fs::PathToString (result.filename ()) == " ." ) {
253- result = result.parent_path ();
254- }
255-
256- assert (fs::equivalent (result, path.lexically_normal ()));
257- return result;
258- }
259- } // namespace
260-
261248// Define default constructor and destructor that are not inline, so code instantiating this class doesn't need to
262249// #include class definitions for all members.
263250// For example, m_settings has an internal dependency on univalue.
@@ -450,15 +437,16 @@ const fs::path& ArgsManager::GetDataDir(bool net_specific) const
450437 } else {
451438 path = GetDefaultDataDir ();
452439 }
453- if (net_specific)
440+
441+ if (net_specific && !BaseParams ().DataDir ().empty ()) {
454442 path /= fs::PathFromString (BaseParams ().DataDir ());
443+ }
455444
456445 if (fs::create_directories (path)) {
457446 // This is the first run, create wallets subdirectory too
458447 fs::create_directories (path / " wallets" );
459448 }
460449
461- path = StripRedundantLastElementsOfPath (path);
462450 return path;
463451}
464452
You can’t perform that action at this time.
0 commit comments