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
Concept ACK
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:
if (request.params[5].isNull() || request.params[5].get_bool())) {
Done
Concept ACK
Concept ACK
Concept ACK
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");
s/ommitted/omitted/
Done
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
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">
maybe switch this around and have an unchecked "legacy wallet" option here instead?
I think that may be a little confusing?
I think there's something to be said for both options, but I think the current name is slightly better. It highlights what is new instead of what is old.
I suppose you could have a tooltip text that explains in more detail, that there are "legacy wallets" and "descriptor wallets" and what is the difference from a user point of view.
Concept ACK. I've been using descriptor wallets in my application for a year without issue.
Tested ACK https://github.com/bitcoin/bitcoin/pull/23002/commits/9c1052a5218e191fd23c0d9fc06f2fca34b03411 on Ubuntu 20.04
Concept ACK. Tested on Pop!_OS and had only one issue.
$ bitcoin-cli createwallet "D1"
{
"name": "D1",
"warning": ""
}
$ bitcoin-cli -rpcwallet=D1 getwalletinfo
{
"walletname": "D1",
"walletversion": 169900,
"format": "sqlite",
"balance": 0.00000000,
"unconfirmed_balance": 0.00000000,
"immature_balance": 0.00000000,
"txcount": 0,
"keypoolsize": 3000,
"keypoolsize_hd_internal": 3000,
"paytxfee": 0.00000000,
"private_keys_enabled": true,
"avoid_reuse": false,
"scanning": false,
"descriptors": true
}

-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:
src/bitcoin-wallet -legacy -wallet="test_legacy" create
Concept ACK
Code review ACK 9c1052a5218e191fd23c0d9fc06f2fca34b03411
Concept ACK
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?
Changing the default might need release notes, but this can be done later.
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:
bool make_descriptors = args.GetBoolArg("-descriptors", true);
To avoid setting it to true if -legacy is set.
This was part of 23.0 and got a release note. Removing "Needs release note".
Milestone
23.0