Skip to content

Commit dd9a275

Browse files
committed
Merge wallet_undeprecate_legacy-26
2 parents 85f09aa + 6f57931 commit dd9a275

File tree

9 files changed

+43
-29
lines changed

9 files changed

+43
-29
lines changed

src/qt/bitcoingui.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,11 +1308,6 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
13081308
void BitcoinGUI::createWallet()
13091309
{
13101310
#ifdef ENABLE_WALLET
1311-
#ifndef USE_SQLITE
1312-
// Compiled without sqlite support (required for descriptor wallets)
1313-
message(tr("Error creating wallet"), tr("Cannot create new wallet, the software was compiled without sqlite support (required for descriptor wallets)"), CClientUIInterface::MSG_ERROR);
1314-
return;
1315-
#endif // USE_SQLITE
13161311
auto activity = new CreateWalletActivity(getWalletController(), this);
13171312
connect(activity, &CreateWalletActivity::created, this, &BitcoinGUI::setCurrentWallet);
13181313
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
@@ -48,10 +48,12 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
4848
ui->encrypt_wallet_checkbox->setEnabled(!checked);
4949
ui->blank_wallet_checkbox->setEnabled(!checked);
5050
ui->disable_privkeys_checkbox->setEnabled(!checked);
51+
ui->descriptor_checkbox->setEnabled(!checked);
5152

5253
// The external signer checkbox is only enabled when a device is detected.
5354
// In that case it is checked by default. Toggling it restores the other
5455
// options to their default.
56+
ui->descriptor_checkbox->setChecked(checked);
5557
ui->encrypt_wallet_checkbox->setChecked(false);
5658
ui->disable_privkeys_checkbox->setChecked(checked);
5759
ui->blank_wallet_checkbox->setChecked(false);
@@ -83,6 +85,19 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
8385
}
8486
});
8587

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

156+
bool CreateWalletDialog::isDescriptorWalletChecked() const
157+
{
158+
return ui->descriptor_checkbox->isChecked();
159+
}
160+
141161
bool CreateWalletDialog::isExternalSignerChecked() const
142162
{
143163
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
@@ -254,14 +254,15 @@ void CreateWalletActivity::createWallet()
254254

255255
std::string name = m_create_wallet_dialog->walletName().toStdString();
256256
uint64_t flags = 0;
257-
// Enable descriptors by default.
258-
flags |= WALLET_FLAG_DESCRIPTORS;
259257
if (m_create_wallet_dialog->isDisablePrivateKeysChecked()) {
260258
flags |= WALLET_FLAG_DISABLE_PRIVATE_KEYS;
261259
}
262260
if (m_create_wallet_dialog->isMakeBlankWalletChecked()) {
263261
flags |= WALLET_FLAG_BLANK_WALLET;
264262
}
263+
if (m_create_wallet_dialog->isDescriptorWalletChecked()) {
264+
flags |= WALLET_FLAG_DESCRIPTORS;
265+
}
265266
if (m_create_wallet_dialog->isExternalSignerChecked()) {
266267
flags |= WALLET_FLAG_EXTERNAL_SIGNER;
267268
}

src/wallet/rpc/wallet.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ static RPCHelpMan createwallet()
370370
{"passphrase", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Encrypt the wallet with this passphrase."},
371371
{"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{false}, "Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind."},
372372
{"descriptors", RPCArg::Type::BOOL, RPCArg::Default{true}, "Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation."
373-
" Setting to \"false\" will create a legacy wallet; This is only possible with the -deprecatedrpc=create_bdb setting because, the legacy wallet type is being deprecated and"
374-
" support for creating and opening legacy wallets will be removed in the future."},
373+
" Setting to \"false\" will create a legacy wallet"},
375374
{"load_on_startup", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
376375
{"external_signer", RPCArg::Type::BOOL, RPCArg::Default{false}, "Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true."},
377376
},
@@ -429,11 +428,6 @@ static RPCHelpMan createwallet()
429428
throw JSONRPCError(RPC_WALLET_ERROR, "Compiled without sqlite support (required for descriptor wallets)");
430429
#endif
431430
flags |= WALLET_FLAG_DESCRIPTORS;
432-
} else {
433-
if (!context.chain->rpcEnableDeprecated("create_bdb")) {
434-
throw JSONRPCError(RPC_WALLET_ERROR, "BDB wallet creation is deprecated and will be removed in a future release."
435-
" In this release it can be re-enabled temporarily with the -deprecatedrpc=create_bdb setting.");
436-
}
437431
}
438432
if (!request.params[7].isNull() && request.params[7].get_bool()) {
439433
#ifdef ENABLE_EXTERNAL_SIGNER

src/wallet/wallet.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,6 @@ std::shared_ptr<CWallet> LoadWalletInternal(WalletContext& context, const std::s
293293
return nullptr;
294294
}
295295

296-
// Legacy wallets are being deprecated, warn if the loaded wallet is legacy
297-
if (!wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
298-
warnings.push_back(_("Wallet loaded successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future. Legacy wallets can be migrated to a descriptor wallet with migratewallet."));
299-
}
300-
301296
NotifyWalletLoaded(context, wallet);
302297
AddWallet(context, wallet);
303298
wallet->postInitProcess();
@@ -486,11 +481,6 @@ std::shared_ptr<CWallet> CreateWallet(WalletContext& context, const std::string&
486481
// Write the wallet settings
487482
UpdateWalletSetting(*context.chain, name, load_on_start, warnings);
488483

489-
// Legacy wallets are being deprecated, warn if a newly created wallet is legacy
490-
if (!(wallet_creation_flags & WALLET_FLAG_DESCRIPTORS)) {
491-
warnings.push_back(_("Wallet created successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future."));
492-
}
493-
494484
status = DatabaseStatus::SUCCESS;
495485
return wallet;
496486
}

test/functional/wallet_backwards_compatibility.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,9 @@ def run_test(self):
339339
# Restore the wallet to master
340340
load_res = node_master.restorewallet(wallet_name, backup_path)
341341

342-
# Make sure this wallet opens with only the migration warning. See https://github.com/bitcoin/bitcoin/pull/19054
342+
# Make sure this wallet opens without warnings
343343
if not self.options.descriptors:
344-
# Legacy wallets will have only a deprecation warning
345-
assert_equal(load_res["warnings"], ["Wallet loaded successfully. The legacy wallet type is being deprecated and support for creating and opening legacy wallets will be removed in the future. Legacy wallets can be migrated to a descriptor wallet with migratewallet."])
344+
assert "warnings" not in load_res
346345
else:
347346
assert "warnings" not in load_res
348347

test/functional/wallet_createwallet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def run_test(self):
161161
assert_equal(walletinfo['keypoolsize_hd_internal'], keys)
162162
# Allow empty passphrase, but there should be a warning
163163
resp = self.nodes[0].createwallet(wallet_name='w7', disable_private_keys=False, blank=False, passphrase='')
164-
assert_equal(resp["warnings"], [EMPTY_PASSPHRASE_MSG] if self.options.descriptors else [EMPTY_PASSPHRASE_MSG, LEGACY_WALLET_MSG])
164+
assert_equal(resp["warnings"], [EMPTY_PASSPHRASE_MSG])
165165

166166
w7 = node.get_wallet_rpc('w7')
167167
assert_raises_rpc_error(-15, 'Error: running with an unencrypted wallet, but walletpassphrase was called.', w7.walletpassphrase, '', 60)
@@ -175,7 +175,7 @@ def run_test(self):
175175
self.log.info('Using a passphrase with private keys disabled returns error')
176176
assert_raises_rpc_error(-4, 'Passphrase provided but private keys are disabled. A passphrase is only used to encrypt private keys, so cannot be used for wallets with private keys disabled.', self.nodes[0].createwallet, wallet_name='w9', disable_private_keys=True, passphrase='thisisapassphrase')
177177

178-
if self.is_bdb_compiled():
178+
if False:
179179
self.log.info("Test legacy wallet deprecation")
180180
result = self.nodes[0].createwallet(wallet_name="legacy_w0", descriptors=False, passphrase=None)
181181
assert_equal(result, {

0 commit comments

Comments
 (0)