mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 09:55:49 +02:00
Introduce (and use) an IsArgSet accessor method
This commit is contained in:
@@ -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 = "";
|
||||
|
||||
Reference in New Issue
Block a user