Merge #8760: [init] Get rid of some ENABLE_WALLET

faddd62 init: Get rid of some ENABLE_WALLET (MarcoFalke)
This commit is contained in:
Wladimir J. van der Laan 2016-09-20 12:45:28 +02:00 committed by Alexander Block
parent a5a9e46042
commit fbbddf8107
2 changed files with 12 additions and 16 deletions

View File

@ -869,10 +869,7 @@ void InitParameterInteraction()
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)) { if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)) {
if (SoftSetBoolArg("-whitelistrelay", false)) if (SoftSetBoolArg("-whitelistrelay", false))
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__); LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__);
#ifdef ENABLE_WALLET // walletbroadcast is disabled in CWallet::ParameterInteraction()
if (SoftSetBoolArg("-walletbroadcast", false))
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
#endif
} }
// Forcing relay from whitelisted hosts implies we will accept relays from them in the first place. // Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
@ -970,12 +967,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError("Initializing networking failed"); return InitError("Initializing networking failed");
#ifndef WIN32 #ifndef WIN32
if (GetBoolArg("-sysperms", false)) { if (!GetBoolArg("-sysperms", false)) {
#ifdef ENABLE_WALLET
if (!GetBoolArg("-disablewallet", false))
return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
#endif
} else {
umask(077); umask(077);
} }
@ -1003,15 +995,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// also see: InitParameterInteraction() // also see: InitParameterInteraction()
// if using block pruning, then disable txindex // if using block pruning, then disallow txindex
if (GetArg("-prune", 0)) { if (GetArg("-prune", 0)) {
if (GetBoolArg("-txindex", DEFAULT_TXINDEX)) if (GetBoolArg("-txindex", DEFAULT_TXINDEX))
return InitError(_("Prune mode is incompatible with -txindex.")); return InitError(_("Prune mode is incompatible with -txindex."));
#ifdef ENABLE_WALLET
if (GetBoolArg("-rescan", false)) {
return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
}
#endif
} }
if (mapArgs.count("-devnet")) { if (mapArgs.count("-devnet")) {

View File

@ -4740,6 +4740,15 @@ bool CWallet::InitLoadWallet()
bool CWallet::ParameterInteraction() bool CWallet::ParameterInteraction()
{ {
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && SoftSetBoolArg("-walletbroadcast", false)) {
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
}
if (GetBoolArg("-sysperms", false))
return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
if (GetArg("-prune", 0) && GetBoolArg("-rescan", false))
return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
if (mapArgs.count("-mintxfee")) if (mapArgs.count("-mintxfee"))
{ {
CAmount n = 0; CAmount n = 0;