Skip to content

Commit 6666ca6

Browse files
author
MarcoFalke
committed
[qt] WalletModel: Expose disablewallet
1 parent fa58edb commit 6666ca6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/qt/bitcoingui.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
7777

7878
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
7979
QMainWindow(parent),
80+
enableWallet(false),
8081
clientModel(0),
8182
walletFrame(0),
8283
unitDisplayControl(0),
@@ -122,10 +123,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n
122123

123124
QString windowTitle = tr(PACKAGE_NAME) + " - ";
124125
#ifdef ENABLE_WALLET
125-
/* if compiled with wallet support, -disablewallet can still disable the wallet */
126-
enableWallet = !GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
127-
#else
128-
enableWallet = false;
126+
enableWallet = WalletModel::isWalletEnabled();
129127
#endif // ENABLE_WALLET
130128
if(enableWallet)
131129
{

src/qt/walletmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ bool WalletModel::abandonTransaction(uint256 hash) const
684684
return wallet->AbandonTransaction(hash);
685685
}
686686

687+
bool WalletModel::isWalletEnabled()
688+
{
689+
return !GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
690+
}
691+
687692
bool WalletModel::hdEnabled() const
688693
{
689694
return wallet->IsHDEnabled();

src/qt/walletmodel.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ class WalletModel : public QObject
203203
bool transactionCanBeAbandoned(uint256 hash) const;
204204
bool abandonTransaction(uint256 hash) const;
205205

206+
static bool isWalletEnabled();
207+
206208
bool hdEnabled() const;
207209

208210
private:

0 commit comments

Comments
 (0)