Skip to content

Commit aefb4c4

Browse files
committed
GUI: Restore legacy wallet creation
This partially reverts commit b442580.
1 parent 96ec3b6 commit aefb4c4

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,6 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
11891189
void BitcoinGUI::createWallet()
11901190
{
11911191
#ifdef ENABLE_WALLET
1192-
#ifndef USE_SQLITE
1193-
// Compiled without sqlite support (required for descriptor wallets)
1194-
message(tr("Error creating wallet"), tr("Cannot create new wallet, the software was compiled without sqlite support (required for descriptor wallets)"), CClientUIInterface::MSG_ERROR);
1195-
return;
1196-
#endif // USE_SQLITE
11971192
auto activity = new CreateWalletActivity(getWalletController(), this);
11981193
connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);
11991194
connect(activity, &CreateWalletActivity::created, rpcConsole, &RPCConsole::setCurrentWallet);

src/qt/createwalletdialog.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
5050
ui->encrypt_wallet_checkbox->setEnabled(!checked);
5151
ui->blank_wallet_checkbox->setEnabled(!checked);
5252
ui->disable_privkeys_checkbox->setEnabled(!checked);
53+
ui->descriptor_checkbox->setEnabled(!checked);
5354

5455
// The external signer checkbox is only enabled when a device is detected.
5556
// In that case it is checked by default. Toggling it restores the other
5657
// options to their default.
58+
ui->descriptor_checkbox->setChecked(checked);
5759
ui->encrypt_wallet_checkbox->setChecked(false);
5860
ui->disable_privkeys_checkbox->setChecked(checked);
5961
ui->blank_wallet_checkbox->setChecked(false);
@@ -85,6 +87,19 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
8587
}
8688
});
8789

90+
#ifndef USE_SQLITE
91+
ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)"));
92+
ui->descriptor_checkbox->setEnabled(false);
93+
ui->descriptor_checkbox->setChecked(false);
94+
ui->external_signer_checkbox->setEnabled(false);
95+
ui->external_signer_checkbox->setChecked(false);
96+
#endif
97+
98+
#ifndef USE_BDB
99+
ui->descriptor_checkbox->setEnabled(false);
100+
ui->descriptor_checkbox->setChecked(true);
101+
#endif
102+
88103
#ifndef ENABLE_EXTERNAL_SIGNER
89104
//: "External signing" means using devices such as hardware wallets.
90105
ui->external_signer_checkbox->setToolTip(tr("Compiled without external signing support (required for external signing)"));
@@ -140,6 +155,11 @@ bool CreateWalletDialog::isMakeBlankWalletChecked() const
140155
return ui->blank_wallet_checkbox->isChecked();
141156
}
142157

158+
bool CreateWalletDialog::isDescriptorWalletChecked() const
159+
{
160+
return ui->descriptor_checkbox->isChecked();
161+
}
162+
143163
bool CreateWalletDialog::isExternalSignerChecked() const
144164
{
145165
return ui->external_signer_checkbox->isChecked();

src/qt/createwalletdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class CreateWalletDialog : public QDialog
3535
bool isEncryptWalletChecked() const;
3636
bool isDisablePrivateKeysChecked() const;
3737
bool isMakeBlankWalletChecked() const;
38+
bool isDescriptorWalletChecked() const;
3839
bool isExternalSignerChecked() const;
3940

4041
private:

src/qt/forms/createwalletdialog.ui

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,19 @@
153153
</property>
154154
</widget>
155155
</item>
156+
<item>
157+
<widget class="QCheckBox" name="descriptor_checkbox">
158+
<property name="toolTip">
159+
<string>Use descriptors for scriptPubKey management</string>
160+
</property>
161+
<property name="text">
162+
<string>Descriptor Wallet</string>
163+
</property>
164+
<property name="checked">
165+
<bool>true</bool>
166+
</property>
167+
</widget>
168+
</item>
156169
<item>
157170
<widget class="QCheckBox" name="external_signer_checkbox">
158171
<property name="toolTip">
@@ -196,6 +209,7 @@
196209
<tabstop>encrypt_wallet_checkbox</tabstop>
197210
<tabstop>disable_privkeys_checkbox</tabstop>
198211
<tabstop>blank_wallet_checkbox</tabstop>
212+
<tabstop>descriptor_checkbox</tabstop>
199213
<tabstop>external_signer_checkbox</tabstop>
200214
</tabstops>
201215
<resources/>

src/qt/walletcontroller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ void CreateWalletActivity::createWallet()
250250

251251
std::string name = m_create_wallet_dialog->walletName().toStdString();
252252
uint64_t flags = 0;
253-
// Enable descriptors by default.
254-
flags |= WALLET_FLAG_DESCRIPTORS;
255253
if (m_create_wallet_dialog->isDisablePrivateKeysChecked()) {
256254
flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS;
257255
}
258256
if (m_create_wallet_dialog->isMakeBlankWalletChecked()) {
259257
flags |= WALLET_FLAG_BLANK_WALLET;
260258
}
259+
if (m_create_wallet_dialog->isDescriptorWalletChecked()) {
260+
flags |= WALLET_FLAG_DESCRIPTORS;
261+
}
261262
if (m_create_wallet_dialog->isExternalSignerChecked()) {
262263
flags |= WALLET_FLAG_EXTERNAL_SIGNER;
263264
}

0 commit comments

Comments
 (0)