-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spent utxo still listed as unspent #5959
Comments
Is there anything that we can do to obtain relevant data from this node to help pinpoint the problem? |
The problem seems to be the single output that only sends to a channel funding TX, which the wallet doesn't recognize as its own. Wasn't aware this issue was already around, we're tracking this in #6434 now. |
@joostjager I finally found some time to attempt to reproduce this. So far I wasn't able to. Did you only run into this a single time or do you know a pattern that produces the problem more often? |
We ran into this a single time. Unfortunately no pattern. |
@joostjager I found the problem for #6434 today. Turned out that when sending funds to a P2WKH address that was created from the pubkey returned by |
I checked our code base, and nowhere we use |
Hmm, okay. What's the state of this transaction at the moment? Did it eventually correct itself or is the UTXO still being listed as unspent? |
The transaction that spent the utxo is still not listed. The following command yields empty:
We've put a long utxo lease on the "utxo" which is not unspent to prevent it from being selected ever again... |
So the UTXO shows for address Was the wallet ever re-scanned with |
It's currently not showing because we've locked it manually. The wallet was never re-scanned. If that would solve it, it remains a question why it happened in the first place.
|
Ah, right, that's only on master, sorry... Would've been useful here. I do have a suspicion why it happened. But without knowing what type of address it is (default scope or non-default scope) it's hard to say. |
How can it be a non-default address if Derive(Next)Key was never called? It's most likely also an external address, not belonging to our wallet. Anything else we can do at this point? |
On my node I experience this issue with transactions that are sweep transactions:
Both 9ca... and f9a... spend from the same input. Both outputs are shown in |
@C-Otto are either of these two transactions confirmed yet? I think one of them will go away if the other one confirms (making this a slightly different case than the original problem stated in the issue). |
Here's the confirmed TX that successfully spent the output: The TXs I mentioned before are not shown in |
Background
We have a transaction X that is confirmed on-chain, but somehow its input is still listed by
lncli listunspent
. Transaction X also isn't listed bylncli listchaintxns
. This causes that utxo to be coin-selected byFundPsbt
, leading to invalid transactions ('input already spent').Transaction X was created via
FundPsbt
and submitted viaPublishTransaction
. It is a one-in-one-out tx.It seems that this problem started after a restart of lnd. We monitor the node via lndmon and record the minimum utxo size. The problematic utxo is small. After the restart, we saw the min utxo size dip down to the size of that utxo. As if the restart made lnd forget about the transaction.
Your environment
The text was updated successfully, but these errors were encountered: