Skip to content

Commit

Permalink
Check for more than private keys disabled to show receive button
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Jan 22, 2019
1 parent 6e6b3b9 commit 14bcdbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class WalletModel : public QObject

static bool isWalletEnabled();
bool privateKeysDisabled() const;
bool canGetAddresses() const;

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

0 comments on commit 14bcdbe

Please sign in to comment.