diff options
| author | Pieter Wuille <[email protected]> | 2013-05-03 04:52:03 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2013-05-03 04:52:03 -0700 |
| commit | b45fd0a5a443be4b483e663c661e8cf650793d83 (patch) | |
| tree | 0cff4533e21d89bd1899268b6071cf6a7e3bb846 /src/util.cpp | |
| parent | Merge pull request #2601 from jgarzik/uri-validate (diff) | |
| parent | clear path cache after getting a proper config file (fixes #2605) (diff) | |
| download | discoin-b45fd0a5a443be4b483e663c661e8cf650793d83.tar.xz discoin-b45fd0a5a443be4b483e663c661e8cf650793d83.zip | |
Merge pull request #2608 from jonasschnelli/pathCacheFix
clear path cache after getting a proper config file (fixes #2605)
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util.cpp b/src/util.cpp index 8b6d8b32c..4c9b897f5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -83,6 +83,7 @@ bool fNoListen = false; bool fLogTimestamps = false; CMedianFilter<int64> vTimeOffsets(200,0); volatile bool fReopenDebugLog = false; +bool fCachedPath[2] = {false, false}; // Init OpenSSL library multithreading support static CCriticalSection** ppmutexOpenSSL; @@ -1048,13 +1049,12 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) static fs::path pathCached[2]; static CCriticalSection csPathCached; - static bool cachedPath[2] = {false, false}; fs::path &path = pathCached[fNetSpecific]; // This can be called during exceptions by printf, so we cache the // value so we don't have to do memory allocations after that. - if (cachedPath[fNetSpecific]) + if (fCachedPath[fNetSpecific]) return path; LOCK(csPathCached); @@ -1073,7 +1073,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) fs::create_directory(path); - cachedPath[fNetSpecific] = true; + fCachedPath[fNetSpecific] = true; return path; } @@ -1091,6 +1091,9 @@ void ReadConfigFile(map<string, string>& mapSettingsRet, if (!streamConfig.good()) return; // No bitcoin.conf file is OK + // clear path cache after loading config file + fCachedPath[0] = fCachedPath[1] = false; + set<string> setOptions; setOptions.insert("*"); |