Skip to content

Commit 14bcdbe

Browse files
committed
Check for more than private keys disabled to show receive button
1 parent 6e6b3b9 commit 14bcdbe

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/qt/receivecoinsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
101101
}
102102

103103
// eventually disable the main receive button if private key operations are disabled
104-
ui->receiveButton->setEnabled(!model->privateKeysDisabled());
104+
ui->receiveButton->setEnabled(model->canGetAddresses());
105105
}
106106
}
107107

src/qt/walletmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ bool WalletModel::privateKeysDisabled() const
571571
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
572572
}
573573

574+
bool WalletModel::canGetAddresses() const
575+
{
576+
return m_wallet->hdEnabled() || (!m_wallet->hdEnabled() && !m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
577+
}
578+
574579
QString WalletModel::getWalletName() const
575580
{
576581
return QString::fromStdString(m_wallet->getWalletName());

src/qt/walletmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class WalletModel : public QObject
214214

215215
static bool isWalletEnabled();
216216
bool privateKeysDisabled() const;
217+
bool canGetAddresses() const;
217218

218219
interfaces::Node& node() const { return m_node; }
219220
interfaces::Wallet& wallet() const { return *m_wallet; }

0 commit comments

Comments
 (0)