aboutsummaryrefslogtreecommitdiff
path: root/src/qt/receivecoinsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/receivecoinsdialog.cpp')
-rw-r--r--src/qt/receivecoinsdialog.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp
index bc96b5a6f7..22a79a12bb 100644
--- a/src/qt/receivecoinsdialog.cpp
+++ b/src/qt/receivecoinsdialog.cpp
@@ -100,8 +100,13 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
ui->useBech32->setCheckState(Qt::Unchecked);
}
- // eventually disable the main receive button if private key operations are disabled
- ui->receiveButton->setEnabled(!model->privateKeysDisabled());
+ // Set the button to be enabled or disabled based on whether the wallet can give out new addresses.
+ ui->receiveButton->setEnabled(model->canGetAddresses());
+
+ // Enable/disable the receive button if the wallet is now able/unable to give out new addresses.
+ connect(model, &WalletModel::canGetAddressesChanged, [this] {
+ ui->receiveButton->setEnabled(model->canGetAddresses());
+ });
}
}