Merge pull request #6125

472b4c5 Clean up parsing of bool command line args (Alex Morcos)
This commit is contained in:
Gavin Andresen 2015-05-13 14:43:31 -04:00
commit 351f73ecd5
No known key found for this signature in database
GPG Key ID: 7588242FBE38D3A8

View File

@ -834,13 +834,13 @@ bool AppInit2(boost::thread_group& threadGroup)
} }
} }
nTxConfirmTarget = GetArg("-txconfirmtarget", 1); nTxConfirmTarget = GetArg("-txconfirmtarget", 1);
bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); bSpendZeroConfChange = GetBoolArg("-spendzeroconfchange", true);
fSendFreeTransactions = GetArg("-sendfreetransactions", false); fSendFreeTransactions = GetBoolArg("-sendfreetransactions", false);
std::string strWalletFile = GetArg("-wallet", "wallet.dat"); std::string strWalletFile = GetArg("-wallet", "wallet.dat");
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
fIsBareMultisigStd = GetArg("-permitbaremultisig", true) != 0; fIsBareMultisigStd = GetBoolArg("-permitbaremultisig", true);
nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes); nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes);
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
@ -955,7 +955,7 @@ bool AppInit2(boost::thread_group& threadGroup)
proxyType addrProxy; proxyType addrProxy;
bool fProxy = false; bool fProxy = false;
if (mapArgs.count("-proxy")) { if (mapArgs.count("-proxy")) {
addrProxy = proxyType(CService(mapArgs["-proxy"], 9050), GetArg("-proxyrandomize", true)); addrProxy = proxyType(CService(mapArgs["-proxy"], 9050), GetBoolArg("-proxyrandomize", true));
if (!addrProxy.IsValid()) if (!addrProxy.IsValid())
return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"])); return InitError(strprintf(_("Invalid -proxy address: '%s'"), mapArgs["-proxy"]));
@ -972,7 +972,7 @@ bool AppInit2(boost::thread_group& threadGroup)
if (!mapArgs.count("-onion")) if (!mapArgs.count("-onion"))
addrOnion = addrProxy; addrOnion = addrProxy;
else else
addrOnion = proxyType(CService(mapArgs["-onion"], 9050), GetArg("-proxyrandomize", true)); addrOnion = proxyType(CService(mapArgs["-onion"], 9050), GetBoolArg("-proxyrandomize", true));
if (!addrOnion.IsValid()) if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs["-onion"])); return InitError(strprintf(_("Invalid -onion address: '%s'"), mapArgs["-onion"]));
SetProxy(NET_TOR, addrOnion); SetProxy(NET_TOR, addrOnion);