Use descriptor wallet for Bitcoin Core >= v0.21.0#737
Conversation
62efd30 to
54799c2
Compare
|
Thanks a lot for the PR! Looks good.
I'll have a look over the weekend what we need to change for that and also test your PR :) |
|
There's also the Another thing that would be useful is if the test suite can download Bitcoin Core binaries and test against different versions (since we really should test against 0.21 and an older version). This script makes that very easy: https://github.com/bitcoin/bitcoin/blob/master/test/get_previous_releases.py |
|
For the reference, i'm adding this link which seems to be the best source in order to understand what this PR is about: |
cd73bc0 to
f728294
Compare
|
I rebased on master, so there's no need for the merge commit... |
|
Looks great, thanks! The only thing which is an issue currently is that without the keypool management from Specter the addresses caching in CSV stops working, and we currently rely on that for quite a bit. We'll have to figure out first how to keep the addresses caching up to date properly without relying on keypool refill events on Specter. |
|
Hi @Sjors, I've worked on this PR now to fix the address caching issue, and also a coin control issue and support the new Would it be fine if I just push directly over here to this PR? |
|
@ben-kaufman that's fine by me |
f728294 to
5e553b6
Compare
|
Great, just pushed it, tested with Core 0.21 and 0.20, and everything looks good to me now |
|
tACK c8dd881 Tested on Signet with Bitcoin Core v0.21 by creating a new 2-of-2 wallet, receiving coins on it and then sending them. |
| len( | ||
| [ | ||
| tx | ||
| for tx in self._transactions | ||
| if self._transactions[tx]["category"] != "send" | ||
| and not self._transactions[tx]["address"] | ||
| ] | ||
| ) | ||
| != 0 |
First part of #707.
This PR checks if Bitcoin Core is v0.21.0 or above. If so it creates a descriptor wallet.
We then check for each wallet if it's a descriptor wallet (since the node may have been upgraded after a wallet was created), using
getwalletinfo.Descriptor wallets use
importdescriptorsinstead ofimportmulti. This means thegetnewaddressRPC works as well as the Receive tab in the Bitcoin Core GUI.Balance is checked with
minerather thanwatchonlyfor descriptor wallets.For descriptor wallets we no longer refill the keypool. There's a bunch of other address management code that can probably be skipped, but I don't know how it works. I bypassed the
self._addresses.addstuff inkeypoolrefill, which seems to work.