From 0fcf91ea1e23697736032caadc8e487e0ba6cfef Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 3 Jan 2012 10:14:22 -0500 Subject: Fix issue #659, and cleanup wallet/command-line argument handling a bit --- src/util.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index a45ce33a1..3805e077a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -470,6 +470,23 @@ void ParseParameters(int argc, char* argv[]) } } +bool SoftSetArg(const std::string& strArg, const std::string& strValue) +{ + if (mapArgs.count(strArg)) + return false; + mapArgs[strArg] = strValue; + return true; +} + +bool SoftSetArg(const std::string& strArg, bool fValue) +{ + if (fValue) + return SoftSetArg(strArg, std::string("1")); + else + return SoftSetArg(strArg, std::string("0")); +} + + string EncodeBase64(const unsigned char* pch, size_t len) { static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -- cgit v1.2.3