From 0cf86a6678413aa03e765a7133f048df4001ff4c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 29 Nov 2016 17:51:30 -0800 Subject: Introduce (and use) an IsArgSet accessor method --- src/util.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 6625ac932..cef3e97c2 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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 = ""; -- cgit v1.2.3