Skip to content

Commit faddd62

Browse files
author
MarcoFalke
committed
init: Get rid of some ENABLE_WALLET
1 parent 9ac0130 commit faddd62

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src/init.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -759,10 +759,7 @@ void InitParameterInteraction()
759759
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)) {
760760
if (SoftSetBoolArg("-whitelistrelay", false))
761761
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__);
762-
#ifdef ENABLE_WALLET
763-
if (SoftSetBoolArg("-walletbroadcast", false))
764-
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
765-
#endif
762+
// walletbroadcast is disabled in CWallet::ParameterInteraction()
766763
}
767764

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

823820
#ifndef WIN32
824-
if (GetBoolArg("-sysperms", false)) {
825-
#ifdef ENABLE_WALLET
826-
if (!GetBoolArg("-disablewallet", false))
827-
return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
828-
#endif
829-
} else {
821+
if (!GetBoolArg("-sysperms", false)) {
830822
umask(077);
831823
}
832824

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

855847
// also see: InitParameterInteraction()
856848

857-
// if using block pruning, then disable txindex
849+
// if using block pruning, then disallow txindex
858850
if (GetArg("-prune", 0)) {
859851
if (GetBoolArg("-txindex", DEFAULT_TXINDEX))
860852
return InitError(_("Prune mode is incompatible with -txindex."));
861-
#ifdef ENABLE_WALLET
862-
if (GetBoolArg("-rescan", false)) {
863-
return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
864-
}
865-
#endif
866853
}
867854

868855
// Make sure enough file descriptors are available

src/wallet/wallet.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,15 @@ bool CWallet::InitLoadWallet()
34463446

34473447
bool CWallet::ParameterInteraction()
34483448
{
3449+
if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && SoftSetBoolArg("-walletbroadcast", false)) {
3450+
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
3451+
}
3452+
3453+
if (GetBoolArg("-sysperms", false))
3454+
return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
3455+
if (GetArg("-prune", 0) && GetBoolArg("-rescan", false))
3456+
return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
3457+
34493458
if (mapArgs.count("-mintxfee"))
34503459
{
34513460
CAmount n = 0;

0 commit comments

Comments
 (0)