Fix issue #659, and cleanup wallet/command-line argument handling a bit

This commit is contained in:
Gavin Andresen
2012-01-03 10:14:22 -05:00
parent 4231eb217c
commit 0fcf91ea1e
5 changed files with 84 additions and 43 deletions

View File

@@ -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+/";