Issue Details
- Number
- 26813
- Title
- listreceivedbyaddress is empty for descriptor (but not legacy) wallets
- Description
- https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
Problem: listreceivedbyaddress always returns an empty array for a watch-only wallet when it's of type descriptor (not legacy). This problem doesn't occur with a legacy watch-only wallet, only a descriptor watch-only wallet.
Apparent reason: bitcoind thinks the addresses are for change.
Work-around: When importing descriptors, set active=true.
Thanks to achow101 on IRC Libera Chat #bitcoin-core-dev, 2023-01-04.
```
$ cat $HOME/data1/bitcoin.conf
printtoconsole=1
regtest=1
txindex=1
[regtest]
port=18444
rpcport=18443
$ $HOME/bitcoin-24.0.1/bin/bitcoin-qt -datadir=$HOME/data1 -server -fallbackfee=0.00001 &
$ cat bcli.sh
#!/bin/bash
$HOME/bitcoin-24.0.1/bin/bitcoin-cli -datadir=$HOME/data1 "$@"
$ bcli.sh createwallet w1
$ bcli.sh createwallet w2 true true
$ bcli.sh -rpcwallet=w1 listdescriptors
...
{
"desc": "wpkh([577ce3ca/84'/1'/0']tpubDCNwCevBBSLGZm5d2urnpLDD2B4s5dWf7TRigFngte9M7sijNQg6QVjq1K7Nb7uLAP7xLn2h4X1MoiT3JmMP3sQYuKsY1qnPj1HR63hQDuT/0/*)#cw6xz6mx",
"timestamp": 1672848018,
"active": true,
"internal": false,
"range": [
0,
999
],
"next": 0
},
...
$ bcli.sh -rpcwallet=w2 importdescriptors "[{\"desc\": \"wpkh([577ce3ca/84'/1'/0']tpubDCNwCevBBSLGZm5d2urnpLDD2B4s5dWf7TRigFngte9M7sijNQg6QVjq1K7Nb7uLAP7xLn2h4X1MoiT3JmMP3sQYuKsY1qnPj1HR63hQDuT/0/*)#cw6xz6mx\", \"timestamp\": 0, \"range\": 999}]"
$ bcli.sh -rpcwallet=w1 getnewaddress
bcrt1qxu3fl6lyqydvtgxsdpeu69gyywy2dya5a4kray
$ bcli.sh -rpcwallet=w1 generatetoaddress 101 bcrt1qxu3fl6lyqydvtgxsdpeu69gyywy2dya5a4kray
$ bcli.sh -rpcwallet=w2 listreceivedbyaddress 1 true true "" true
[
]
```
- URL
-
https://github.com/bitcoin/bitcoin/issue/26813
- Closed by
-
Back to List