Skip to content

Commit

Permalink
Merge #8760: [init] Get rid of some ENABLE_WALLET
Browse files Browse the repository at this point in the history
faddd62 init: Get rid of some ENABLE_WALLET (MarcoFalke)
  • Loading branch information
laanwj committed Sep 20, 2016
2 parents 82eacc7 + faddd62 commit 02ac669
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,7 @@ void InitParameterInteraction()
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)) {
if (SoftSetBoolArg("-whitelistrelay", false))
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__);
#ifdef ENABLE_WALLET
if (SoftSetBoolArg("-walletbroadcast", false))
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
#endif
// walletbroadcast is disabled in CWallet::ParameterInteraction()
}

// Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
Expand Down Expand Up @@ -821,12 +818,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError("Initializing networking failed");

#ifndef WIN32
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 {
if (!GetBoolArg("-sysperms", false)) {
umask(077);
}

Expand Down Expand Up @@ -854,15 +846,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)

// also see: InitParameterInteraction()

// if using block pruning, then disable txindex
// if using block pruning, then disallow txindex
if (GetArg("-prune", 0)) {
if (GetBoolArg("-txindex", DEFAULT_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
}

// Make sure enough file descriptors are available
Expand Down
9 changes: 9 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3446,6 +3446,15 @@ bool CWallet::InitLoadWallet()

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"))
{
CAmount n = 0;
Expand Down

0 comments on commit 02ac669

Please sign in to comment.