Skip to content

Commit 9ea31eb

Browse files
committed
gui: Disable and uncheck blank when private keys are disabled
Unify the GUI's create wallet with the RPC createwallet so that the blank flag is not set when private keys are disabled.
1 parent da49418 commit 9ea31eb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/qt/createwalletdialog.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,18 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
5858
ui->descriptor_checkbox->setChecked(checked);
5959
ui->encrypt_wallet_checkbox->setChecked(false);
6060
ui->disable_privkeys_checkbox->setChecked(checked);
61-
// The blank check box is ambiguous. This flag is always true for a
62-
// watch-only wallet, even though we immedidately fetch keys from the
63-
// external signer.
64-
ui->blank_wallet_checkbox->setChecked(checked);
61+
ui->blank_wallet_checkbox->setChecked(false);
6562
});
6663

6764
connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) {
6865
// Disable the encrypt_wallet_checkbox when isDisablePrivateKeysChecked is
6966
// set to true, enable it when isDisablePrivateKeysChecked is false.
7067
ui->encrypt_wallet_checkbox->setEnabled(!checked);
7168

72-
// Wallets without private keys start out blank
69+
// Wallets without private keys cannot set blank
70+
ui->blank_wallet_checkbox->setEnabled(!checked);
7371
if (checked) {
74-
ui->blank_wallet_checkbox->setChecked(true);
72+
ui->blank_wallet_checkbox->setChecked(false);
7573
}
7674

7775
// When the encrypt_wallet_checkbox is disabled, uncheck it.
@@ -81,8 +79,11 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
8179
});
8280

8381
connect(ui->blank_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) {
84-
if (!checked) {
85-
ui->disable_privkeys_checkbox->setChecked(false);
82+
// Disable the disable_privkeys_checkbox when blank_wallet_checkbox is checked
83+
// as blank-ness only pertains to wallets with private keys.
84+
ui->disable_privkeys_checkbox->setEnabled(!checked);
85+
if (checked) {
86+
ui->disable_privkeys_checkbox->setChecked(false);
8687
}
8788
});
8889

0 commit comments

Comments
 (0)