Browse Source

Merge #8777: [qt] WalletModel: Expose disablewallet

6666ca6 [qt] WalletModel: Expose disablewallet (MarcoFalke)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
fec6af7440
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/qt/bitcoingui.cpp
  2. 5
      src/qt/walletmodel.cpp
  3. 2
      src/qt/walletmodel.h

6
src/qt/bitcoingui.cpp

@ -77,6 +77,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; @@ -77,6 +77,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
QMainWindow(parent),
enableWallet(false),
clientModel(0),
walletFrame(0),
unitDisplayControl(0),
@ -122,10 +123,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n @@ -122,10 +123,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
QString windowTitle = tr(PACKAGE_NAME) + " - ";
#ifdef ENABLE_WALLET
/* if compiled with wallet support, -disablewallet can still disable the wallet */
enableWallet = !GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
#else
enableWallet = false;
enableWallet = WalletModel::isWalletEnabled();
#endif // ENABLE_WALLET
if(enableWallet)
{

5
src/qt/walletmodel.cpp

@ -684,6 +684,11 @@ bool WalletModel::abandonTransaction(uint256 hash) const @@ -684,6 +684,11 @@ bool WalletModel::abandonTransaction(uint256 hash) const
return wallet->AbandonTransaction(hash);
}
bool WalletModel::isWalletEnabled()
{
return !GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
}
bool WalletModel::hdEnabled() const
{
return wallet->IsHDEnabled();

2
src/qt/walletmodel.h

@ -203,6 +203,8 @@ public: @@ -203,6 +203,8 @@ public:
bool transactionCanBeAbandoned(uint256 hash) const;
bool abandonTransaction(uint256 hash) const;
static bool isWalletEnabled();
bool hdEnabled() const;
private:

Loading…
Cancel
Save