-
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
[bug]: invalid sweep transaction created on forced close #7790
Comments
So I think what happened in your case when a channel is force-closed the lnd-engine will try to sweep your anchor of both commitment transaction (Local and Remote) when using a normal backend one of them will be rejected because their will only be 1 Commitment Transaction in your mempool so the other sweep will be rejected and finally not proposed to the mempool after some failed trails. In your case tho you are using the neutrino backend which has no mempool at all and it seems like the peers were accepting both sweeping transaction. Will test it locally if I have some spare time. Normally your situation should be fixed by a restart because then this other transaction will not be proposed to the mempool anymore because the commitment is already confirmed. Did you try that? |
I tried to restart but it didn't fix anything;
|
Ok tested with a neutrino backend and could reproduce, let me check if I can find a quick fix. Problem is, that it is blocking one of your utxos so this is definitely unintentional behaviour. A quick fix which definitely works is to switch backends for a short time so that the conflicts are resolved. |
Will come up with a fix today for this issue. |
Hello dear friends, I read through this post and I can say that this is also my case. I could successfully recover my funds, but it shows an unconfirmed balance on lncli. I have noticed that LND is having difficulty estimating fees according to the following error messages:
On my node I have a bitcoind running and I can assume that fee estimation is okay. My current LND version is 0.16.2-beta. Please, if you can point me I can bring more information to help figure out what is the problem. |
That's not related to this bug, lnd does the right fee estimation, but anchors are only profitable to sweep up to 1.8 sat/vbyte, lnd will sweep them with the min_relay fee (probably 1sat/vbyte) in your case. Relates to #7939 Preliminary fix which would solve your problem: just increase your min-relay fee of your bitcoin node to 2000 sats/kvb, and restart your lnd node, those sweeps should go away then until the major fix as linked in the PR is production ready |
'--sweeper.notrecoveranchoroutputs=true' is not on the help of my lnd binary. Also, It also doesn't accept this configuration when I call it from command line. By the way, It fails when I try to open a new channel using available on-chain funds, so it seems my funds are actually locked. This is my listunspent entry that has 0 confirmations:
|
This is still a draft PR and not part of the LND suite you are running.
you were tyring with --min_conf=0 ? |
I didn't used option --min_conf=0. I used lncli command line as usual to open a channel. It responded with unsuficient balance error message. By the way, here follows more information on the forced close channel that led to this state:
There is no pending channel information. Seems everything is normal. When I restart LND it doesn't even mention anything about dealing with the unconfirmed balance. It also doesn't try to broadcast any transaction. Following, there is the walletbalance output:
|
I did configured my bitcoind backend to have min_relay fee of 2000 sats/kvb and restart my lnd node. I notice that now at least is trying to publish the tx. But, it still insists to give very low min fee relay. Can I set it anywhere else?
|
You can also increase your mempool size to 1GB ( |
Well, I just followed the recommendation given by Ziggie which was to update my lnd version. The current version is v0.17.0-beta RC2. Everything is fine and the balance is correct! Thanks everybody for the support! |
Is this to avoid my bitcoind backend purging transactions? |
Background
During force-closing of an anchor channel my node created 3 sweep transactions in total including a probably invalid one and its output is "unconfirmed balance" now. Two sweep txns are confirmed, the third is unknown to the mempool. Seems like lnd tried to spend an unknown output that is not part of my
listchaintxns
list.listchaintxns
view of this txn:This is the only mention of
f7f680515d7a0e4d5eebe72c1c6bdaac751fc980147c04a5044c95922b58925a:0
in the whole output. This channel is unknown to lnd, blockchain and mempool.This txn has been created at forced channel close:
closedchannels
output about this channel:Seems like funds are successfully recovered. I have no idea what was the point to create this sweep txn and how to get rid of it.
LND version: v0.16.3-beta
Backend is neutrino (not mine)
Linux mother 6.2.15-200.fc37.aarch64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:16:39 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
The text was updated successfully, but these errors were encountered: