You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
listtransactions fails to list self-send transactions (for imported descriptor wallet) #26096
listtransactions "*" 100 in a wallet with 35 transactions should list all 35 transactions in the wallet.
(Update: and given the way listtransactions works there will likely be more than one array entry for each transaction, right?)
Actual behavior:
listtransactions "*" 100 lists 14 transactions, but does not list 21 transactions that are self-sends.
Note that getwalletinfo returns:
"txcount": 35,
So the wallet does seem to know about the self-send transactions. (The "missing" transactions also show up in the GUI)
To reproduce
I have only seen the problem with one particular wallet. The only other wallet I have tested with is running on an older Bitcoin Core v0.20.1 (actually Omni Core) version and does seem to correctly list self-sends.
The wallet showing the problem is an imported HD tpub descriptor wallet that was created with bitcoinj and then the descriptors were imported via importdescriptors. I noticed that there is a Python functional test for listtransactions that checks self-sends, so perhaps the problem is related to it being a watch-only descriptor wallet with imported descriptors. It may also be relevant that the self-sends had two-outputs, both a "destination" and a change address.
I can reliably reproduce the problem with the wallet that is showing the problem.
System information
MacBook Pro M1
macOS Monterey 12.5.1
Bitcoin Core v23.0.0 pre-built "official" binary.
I am willing to provide additional information and/or run additional tests to help track this down.
The "missing" transactions were likely sent from keys/address in one HD subpath to the other (I recall this but haven't verified)
If you are willing to use listsinceblock instead, i suspect the new include_change parameter added in #25504 would be helpful for you. See #25504 (comment) in particular.
I've been working on a functional test (in Groovy/Spock using the ConsensusJ Bitcoin JSON-RPC client) to reproduce the problem, but haven't succeeded yet.
I assume the fix in #25504 is available in the current v24.0 RC? If so, I will give it a try.
When I get the functional test working, I also may try changing some of the parameters to importdescriptor to see if those are a factor.
For self-send detection to work we need to distinguish between receiving and change addresses. For descriptor wallets we do that by checking internal flag on the descriptor. But internal flag could only be set on an active descriptor. Both your imported descriptors are not active, therefore we can't determine which outputs are change and which are receiving.
For self-send detection to work we need to distinguish between receiving and change addresses. For descriptor wallets we do that by checking internal flag on the descriptor. But internal flag could only be set on an active descriptor. Both your imported descriptors are not active, therefore we can't determine which outputs are change and which are receiving.
@S3RK, #25979 aims to fix that.
note: It's currently up-to-date with master but I should revisit it after that many months.
Activity
aureleoules commentedon Sep 15, 2022
I've tried to reproduce the issue with a python test but it runs fine.
Is this setup close to your situation?
msgilligan commentedon Sep 15, 2022
My situation is different in at least the following ways (I'm not sure which of the differences are salient):
Here is the output of
listdescriptorsfor the wallet:And here is the output of
getwalletinfo:Note the
txcountof35andbalanceof0.23178842. The incorrect balance I calculated fromlisttransactionsis0.23789642.An example of a "missing" transaction is
txid1105265b74dd9d3386d1983971548fffd8f4e3e2a11215695721978e1b108272: https://www.blockchain.com/btc-testnet/tx/1105265b74dd9d3386d1983971548fffd8f4e3e2a11215695721978e1b108272darosior commentedon Sep 22, 2022
If you are willing to use
listsinceblockinstead, i suspect the newinclude_changeparameter added in #25504 would be helpful for you. See #25504 (comment) in particular.msgilligan commentedon Sep 28, 2022
Thanks for the response @darosior!
I've been working on a functional test (in Groovy/Spock using the ConsensusJ Bitcoin JSON-RPC client) to reproduce the problem, but haven't succeeded yet.
I assume the fix in #25504 is available in the current v24.0 RC? If so, I will give it a try.
When I get the functional test working, I also may try changing some of the parameters to
importdescriptorto see if those are a factor.S3RK commentedon Oct 12, 2022
For self-send detection to work we need to distinguish between receiving and change addresses. For descriptor wallets we do that by checking
internalflag on the descriptor. Butinternalflag could only be set on anactivedescriptor. Both your imported descriptors are notactive, therefore we can't determine which outputs are change and which are receiving.darosior commentedon Mar 30, 2023
@msgilligan any luck with your testing?
furszy commentedon Apr 3, 2023
@S3RK, #25979 aims to fix that.
note: It's currently up-to-date with master but I should revisit it after that many months.
achow101 commentedon Jun 7, 2026
Closing as duplicate of #34632 as the preferred approach is being discussed there.
listtransactionsdoes not list tx that spends only change outputs to a change address #34632