Changes the default wallet type from legacy to descriptors. Descriptor wallets will now by the default type. Additionally, descriptor wallets will no longer be marked as experimental.
This follows the timeline proposed in #20160
2765@@ -2766,12 +2766,11 @@ static RPCHelpMan createwallet()
2766 if (!request.params[4].isNull() && request.params[4].get_bool()) {
2767 flags |= WALLET_FLAG_AVOID_REUSE;
2768 }
2769- if (!request.params[5].isNull() && request.params[5].get_bool()) {
2770+ if (request.params[5].isNull() || (!request.params[5].isNull() && request.params[5].get_bool())) {
nit:
0 if (request.params[5].isNull() || request.params[5].get_bool())) {
138+ if (make_legacy && make_descriptors) {
139+ tfm::format(std::cerr, "Only one of -legacy or -descriptors can be set to true, not both\n");
140+ return false;
141+ }
142+ if (!make_legacy && !make_descriptors) {
143+ tfm::format(std::cerr, "One of -legacy or -descriptors must be set to true (or ommitted)\n");
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
106@@ -107,6 +107,9 @@
107 <property name="text">
108 <string>Descriptor Wallet</string>
109 </property>
110+ <property name="checked">
Concept ACK. Tested on Pop!_OS and had only one issue.
0$ bitcoin-cli createwallet "D1"
1{
2 "name": "D1",
3 "warning": ""
4}
5
6$ bitcoin-cli -rpcwallet=D1 getwalletinfo
7{
8 "walletname": "D1",
9 "walletversion": 169900,
10 "format": "sqlite",
11 "balance": 0.00000000,
12 "unconfirmed_balance": 0.00000000,
13 "immature_balance": 0.00000000,
14 "txcount": 0,
15 "keypoolsize": 3000,
16 "keypoolsize_hd_internal": 3000,
17 "paytxfee": 0.00000000,
18 "private_keys_enabled": true,
19 "avoid_reuse": false,
20 "scanning": false,
21 "descriptors": true
22}
-legacy
? I tried using it with bitcoind
, in bitcoin.conf and in bitcoin-cli -named createwallet
. Nothing works. :warning:1. Not sure where should I use `-legacy`? I tried using it with `bitcoind`, in bitcoin.conf and in `bitcoin-cli -named createwallet`. Nothing works.
It is part of the wallet tool, bitcoin-wallet
.
- Not sure where should I use
-legacy
? I tried using it withbitcoind
, in bitcoin.conf and inbitcoin-cli -named createwallet
. Nothing works.
You can test with the following command:
0src/bitcoin-wallet -legacy -wallet="test_legacy" create
As long as #22364 lands before the next major release, it should be fine to merge this. master
shouldn’t be used for anything other than testing, so we don’t have to worry about upgrade paths.
Edit: Also, (experimental) descriptor wallets already exist, so this discussion seems unrelated to this pull request either way?
129@@ -126,7 +130,19 @@ bool ExecuteWalletToolFunc(const ArgsManager& args, const std::string& command)
130 if (command == "create") {
131 DatabaseOptions options;
132 options.require_create = true;
133- if (args.GetBoolArg("-descriptors", false)) {
134+ // If -legacy is set, use it. Otherwise default to false.
135+ bool make_legacy = args.GetBoolArg("-legacy", false);
136+ // If neither -legacy nor -descriptors is set, default to true. If -descriptors is set, use its value.
137+ bool make_descriptors = (!args.IsArgSet("-descriptors") && !args.IsArgSet("-legacy")) || (args.IsArgSet("-descriptors") && args.GetBoolArg("-descriptors", true));
This IsArgSet logic is very strange. Why is this not just:
0bool make_descriptors = args.GetBoolArg("-descriptors", true);
-legacy
is set.