aboutsummaryrefslogtreecommitdiff
path: root/src/qt/createwalletdialog.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-08-05 23:27:53 -0400
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-08-20 10:36:42 +0300
commit6a611d2e3c3ec703b2a034a3dc5422a6535c648b (patch)
tree0f26f256a566ace4d30002e0234a53d659dd7fdc /src/qt/createwalletdialog.cpp
parente9b44876842df254fb4a2856702b74fe8c01ba6d (diff)
gui: ensure external signer option remains disabled without signers
When no external signers are available, the option to enable external signers should always be disabled. However the encrypt wallet checkbox can erroneously re-enable the external signer checkbox. To avoid this, CreateWalletDialog now stores whether signers were available during setSigners so that future calls to external_signer_checkbox->setEnabled can account for whether signers are available. Github-Pull: bitcoin-core/gui#396 Rebased-From: a9b9ca82daefc77ee3c884d3f250460d7cf734a5
Diffstat (limited to 'src/qt/createwalletdialog.cpp')
-rw-r--r--src/qt/createwalletdialog.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp
index dc24bbc6a6..f9a61c3e60 100644
--- a/src/qt/createwalletdialog.cpp
+++ b/src/qt/createwalletdialog.cpp
@@ -32,7 +32,7 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
// set to true, enable it when isEncryptWalletChecked is false.
ui->disable_privkeys_checkbox->setEnabled(!checked);
#ifdef ENABLE_EXTERNAL_SIGNER
- ui->external_signer_checkbox->setEnabled(!checked);
+ ui->external_signer_checkbox->setEnabled(m_has_signers && !checked);
#endif
// When the disable_privkeys_checkbox is disabled, uncheck it.
if (!ui->disable_privkeys_checkbox->isEnabled()) {
@@ -115,7 +115,8 @@ CreateWalletDialog::~CreateWalletDialog()
void CreateWalletDialog::setSigners(const std::vector<ExternalSigner>& signers)
{
- if (!signers.empty()) {
+ m_has_signers = !signers.empty();
+ if (m_has_signers) {
ui->external_signer_checkbox->setEnabled(true);
ui->external_signer_checkbox->setChecked(true);
ui->encrypt_wallet_checkbox->setEnabled(false);