|
|
@ -395,7 +395,8 @@ boost::filesystem::path GetDefaultDataDir() |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static boost::filesystem::path pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1]; |
|
|
|
static boost::filesystem::path pathCached; |
|
|
|
|
|
|
|
static boost::filesystem::path pathCachedNetSpecific; |
|
|
|
static CCriticalSection csPathCached; |
|
|
|
static CCriticalSection csPathCached; |
|
|
|
|
|
|
|
|
|
|
|
const boost::filesystem::path &GetDataDir(bool fNetSpecific) |
|
|
|
const boost::filesystem::path &GetDataDir(bool fNetSpecific) |
|
|
@ -404,10 +405,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) |
|
|
|
|
|
|
|
|
|
|
|
LOCK(csPathCached); |
|
|
|
LOCK(csPathCached); |
|
|
|
|
|
|
|
|
|
|
|
int nNet = CBaseChainParams::MAX_NETWORK_TYPES; |
|
|
|
fs::path &path = fNetSpecific ? pathCachedNetSpecific : pathCached; |
|
|
|
if (fNetSpecific) nNet = BaseParams().NetworkID(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs::path &path = pathCached[nNet]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This can be called during exceptions by LogPrintf(), so we cache the
|
|
|
|
// This can be called during exceptions by LogPrintf(), so we cache the
|
|
|
|
// value so we don't have to do memory allocations after that.
|
|
|
|
// value so we don't have to do memory allocations after that.
|
|
|
@ -433,8 +431,8 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) |
|
|
|
|
|
|
|
|
|
|
|
void ClearDatadirCache() |
|
|
|
void ClearDatadirCache() |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::fill(&pathCached[0], &pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1], |
|
|
|
pathCached = boost::filesystem::path(); |
|
|
|
boost::filesystem::path()); |
|
|
|
pathCachedNetSpecific = boost::filesystem::path(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
boost::filesystem::path GetConfigFile() |
|
|
|
boost::filesystem::path GetConfigFile() |
|
|
|