From fab91070d38aa248a852e04c56dcb73e4022872d Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 19 Sep 2016 16:09:38 +0200 Subject: init: Get rid of fDisableWallet --- src/wallet/rpcwallet.cpp | 3 +++ src/wallet/wallet.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'src/wallet') diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 993caad400..3eb7e5d9ba 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2630,6 +2630,9 @@ static const CRPCCommand commands[] = void RegisterWalletRPCCommands(CRPCTable &t) { + if (GetBoolArg("-disablewallet", false)) + return; + for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) t.appendCommand(commands[vcidx].name, &commands[vcidx]); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7469fd7519..27dd4c0a95 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -414,6 +414,9 @@ void CWallet::Flush(bool shutdown) bool CWallet::Verify() { + if (GetBoolArg("-disablewallet", false)) + return true; + LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0)); std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); @@ -3293,6 +3296,12 @@ std::string CWallet::GetWalletHelpString(bool showDebug) bool CWallet::InitLoadWallet() { + if (GetBoolArg("-disablewallet", false)) { + pwalletMain = NULL; + LogPrintf("Wallet disabled!\n"); + return true; + } + std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); // needed to restore wallet transaction meta data after -zapwallettxes @@ -3464,6 +3473,9 @@ bool CWallet::InitLoadWallet() bool CWallet::ParameterInteraction() { + if (GetBoolArg("-disablewallet", false)) + return true; + if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && SoftSetBoolArg("-walletbroadcast", false)) { LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__); } -- cgit v1.2.3 From fa58edbffe929da45004d4406d7d1ffc7d14dc98 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Wed, 21 Sep 2016 12:15:18 +0200 Subject: [wallet] Introduce DEFAULT_DISABLE_WALLET --- src/wallet/wallet.cpp | 6 +++--- src/wallet/wallet.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 27dd4c0a95..abb1ea7e76 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -414,7 +414,7 @@ void CWallet::Flush(bool shutdown) bool CWallet::Verify() { - if (GetBoolArg("-disablewallet", false)) + if (GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) return true; LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0)); @@ -3296,7 +3296,7 @@ std::string CWallet::GetWalletHelpString(bool showDebug) bool CWallet::InitLoadWallet() { - if (GetBoolArg("-disablewallet", false)) { + if (GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { pwalletMain = NULL; LogPrintf("Wallet disabled!\n"); return true; @@ -3473,7 +3473,7 @@ bool CWallet::InitLoadWallet() bool CWallet::ParameterInteraction() { - if (GetBoolArg("-disablewallet", false)) + if (GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) return true; if (GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && SoftSetBoolArg("-walletbroadcast", false)) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 584f013204..f6c658928f 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -59,7 +59,7 @@ static const bool DEFAULT_WALLET_RBF = false; //! Largest (in bytes) free transaction we're willing to create static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; static const bool DEFAULT_WALLETBROADCAST = true; - +static const bool DEFAULT_DISABLE_WALLET = false; //! if set, all keys will be derived by using BIP32 static const bool DEFAULT_USE_HD_WALLET = true; -- cgit v1.2.3