diff options
| author | Matt Corallo <[email protected]> | 2016-11-29 17:51:30 -0800 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2016-12-23 21:30:16 -0500 |
| commit | 0cf86a6678413aa03e765a7133f048df4001ff4c (patch) | |
| tree | 10846a31ea17a64d66a77f15acc182aeeea43861 /src/util.cpp | |
| parent | Fix non-const mapMultiArgs[] access after init. (diff) | |
| download | discoin-0cf86a6678413aa03e765a7133f048df4001ff4c.tar.xz discoin-0cf86a6678413aa03e765a7133f048df4001ff4c.zip | |
Introduce (and use) an IsArgSet accessor method
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 = ""; |