aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-11-29 17:51:30 -0800
committerMatt Corallo <git@bluematt.me>2016-12-23 21:30:16 -0500
commit0cf86a6678413aa03e765a7133f048df4001ff4c (patch)
tree10846a31ea17a64d66a77f15acc182aeeea43861 /src/util.cpp
parent2b5f085ad11b4b354f48d77e66698fa386c8abbd (diff)
Introduce (and use) an IsArgSet accessor method
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 6625ac9325..cef3e97c28 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 = "";