X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Futil.cpp;h=7322b1e22815fcd163a9f383be52afbdf9c85db0;hb=f4203de3021ca67f065d163b332e9814aee842d8;hp=9f2de3449d4acc3669780282dac146e9337d0023;hpb=8c8e8c2e931b26905112faffb12f527f3256f5dc;p=novacoin.git diff --git a/src/util.cpp b/src/util.cpp index 9f2de34..7322b1e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -870,7 +870,11 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) LOCK(csPathCached); if (mapArgs.count("-datadir")) { - path = mapArgs["-datadir"]; + path = fs::system_complete(mapArgs["-datadir"]); + if (!fs::is_directory(path)) { + path = ""; + return path; + } } else { path = GetDefaultDataDir(); } @@ -892,7 +896,7 @@ boost::filesystem::path GetConfigFile() return pathConfigFile; } -bool ReadConfigFile(map& mapSettingsRet, +void ReadConfigFile(map& mapSettingsRet, map >& mapMultiSettingsRet) { namespace fs = boost::filesystem; @@ -900,7 +904,7 @@ bool ReadConfigFile(map& mapSettingsRet, fs::ifstream streamConfig(GetConfigFile()); if (!streamConfig.good()) - return true; // No bitcoin.conf file is OK + return; // No bitcoin.conf file is OK set setOptions; setOptions.insert("*"); @@ -917,7 +921,6 @@ bool ReadConfigFile(map& mapSettingsRet, } mapMultiSettingsRet[strKey].push_back(it->value[0]); } - return true; } boost::filesystem::path GetPidFile()