MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetDataDir

Method GetDataDir

src/common/args.cpp:335–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335fs::path ArgsManager::GetDataDir(bool net_specific) const
336{
337 AssertLockHeld(cs_args);
338 fs::path& path = net_specific ? m_cached_network_datadir_path : m_cached_datadir_path;
339
340 // Used cached path if available
341 if (!path.empty()) return path;
342
343 const fs::path datadir{GetPathArg_("-datadir")};
344 if (!datadir.empty()) {
345 path = fs::absolute(datadir);
346 if (!fs::is_directory(path)) {
347 path = "";
348 return path;
349 }
350 } else {
351 path = GetDefaultDataDir();
352 }
353
354 if (net_specific && !BaseParams().DataDir().empty()) {
355 path /= fs::PathFromString(BaseParams().DataDir());
356 }
357
358 return path;
359}
360
361void ArgsManager::ClearPathCache()
362{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected