aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-01-03 10:14:22 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-01-03 10:17:28 -0500
commit0fcf91ea1e23697736032caadc8e487e0ba6cfef (patch)
tree4738fbd6c1d7061b58b8492423e3d2fdce48b7f9 /src/util.cpp
parent4231eb217ca06e93cfb0875924b4383f92baf134 (diff)
downloadbitcoin-0fcf91ea1e23697736032caadc8e487e0ba6cfef.tar.xz
Fix issue #659, and cleanup wallet/command-line argument handling a bit
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index a45ce33a1c..3805e077a1 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+/";