aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <[email protected]>2019-01-21 16:49:33 -0500
committerAndrew Chow <[email protected]>2019-01-21 19:39:01 -0500
commit14bcdbe09cffaef9bcc51dd9de1645db3f0a93db (patch)
tree9841a556ec0a0515601e4da88828266ba178f4f1
parentMerge #14955: Switch all RNG code to the built-in PRNG (diff)
downloaddiscoin-14bcdbe09cffaef9bcc51dd9de1645db3f0a93db.tar.xz
discoin-14bcdbe09cffaef9bcc51dd9de1645db3f0a93db.zip
Check for more than private keys disabled to show receive button
-rw-r--r--src/qt/receivecoinsdialog.cpp2
-rw-r--r--src/qt/walletmodel.cpp5
-rw-r--r--src/qt/walletmodel.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index bc96b5a6f..8942188dc 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -101,7 +101,7 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
}
// eventually disable the main receive button if private key operations are disabled
- ui->receiveButton->setEnabled(!model->privateKeysDisabled());
+ ui->receiveButton->setEnabled(model->canGetAddresses());
}
}
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index f13915204..73fce0255 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -571,6 +571,11 @@ bool WalletModel::privateKeysDisabled() const
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
}
+bool WalletModel::canGetAddresses() const
+{
+ return m_wallet->hdEnabled() || (!m_wallet->hdEnabled() && !m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
+}
+
QString WalletModel::getWalletName() const
{
return QString::fromStdString(m_wallet->getWalletName());
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index c3c8f3690..8d7b210d2 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -214,6 +214,7 @@ public:
static bool isWalletEnabled();
bool privateKeysDisabled() const;
+ bool canGetAddresses() const;
interfaces::Node& node() const { return m_node; }
interfaces::Wallet& wallet() const { return *m_wallet; }