Introduce (and use) an IsArgSet accessor method

This commit is contained in:
Matt Corallo
2016-11-29 17:51:30 -08:00
parent 2b5f085ad1
commit 0cf86a6678
12 changed files with 44 additions and 31 deletions

View File

@@ -379,6 +379,11 @@ void ParseParameters(int argc, const char* const argv[])
}
}
bool IsArgSet(const std::string& strArg)
{
return mapArgs.count(strArg);
}
std::string GetArg(const std::string& strArg, const std::string& strDefault)
{
if (mapArgs.count(strArg))
@@ -498,7 +503,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
if (!path.empty())
return path;
if (mapArgs.count("-datadir")) {
if (IsArgSet("-datadir")) {
path = fs::system_complete(mapArgs["-datadir"]);
if (!fs::is_directory(path)) {
path = "";