lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.69k stars 2.08k forks source link

[bug]: Opened channel, tx not broadcast, funds lower #7502

Open AbelLykens opened 1 year ago

AbelLykens commented 1 year ago

Background

Opened a channel from my own node A to my own node B, using CLI. Used 10sat/vB.

lncli openchannel returned a txid. The channel is in pending state in pendingchannels.

But: the tx itself is nowhere to be found. Not in listchaintxns, not in mempool explorer[s]. Funds (walletbalance is lower than before).

Your environment

Steps to reproduce

Open channel, get back txid.

Expected behaviour

Tx to be actually broadcast.

Actual behaviour

Tx nowhere to be found.

Receiving side logs:


lnd[13489]: 2023-03-10 06:21:58.026 [INF] FNDG: completing pending_id(5b6c753e9c3db80d428e238ecfab5f7fbbe2ee4a54de4283cfd689a7469f8376) with ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1)
lnd[13489]: 2023-03-10 06:21:58.030 [INF] FNDG: sending FundingSigned for pending_id(5b6c753e9c3db80d428e238ecfab5f7fbbe2ee4a54de4283cfd689a7469f8376) over ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1)
lnd[13489]: 2023-03-10 06:21:58.030 [INF] CNCT: Creating new ChannelArbitrator for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1)
lnd[13489]: 2023-03-10 06:21:58.030 [INF] CNCT: ChannelArbitrator(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1): starting state=StateDefault, trigger=chainTrigger, triggerHeight=780109
lnd[13489]: 2023-03-10 06:21:58.031 [INF] NTFN: New spend subscription: spend_id=25, outpoint=3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1, script=0 fca91143f7e5cfb087ce34d142d6143994fa0224039e588988ff2314c33db620, height_hint=780109
lnd[13489]: 2023-03-10 06:21:58.031 [INF] NTFN: Dispatching historical spend rescan for outpoint=3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1, script=0 fca91143f7e5cfb087ce34d142d6143994fa0224039e588988ff2314c33db620, start=780109, end=780109
lnd[13489]: 2023-03-10 06:21:58.031 [INF] CNCT: Close observer for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1) active
lnd[13489]: 2023-03-10 06:21:58.031 [INF] NTFN: New confirmation subscription: conf_id=7, txid=3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1, num_confs=6 height_hint=780109
lnd[13489]: 2023-03-10 06:21:58.048 [INF] FNDG: Waiting for funding tx (3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1) to reach 6 confirmations
lnd[13489]: 2023-03-10 06:27:18.725 [WRN] CHBU: Replacing disk backup for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1) w/ newer version
lnd[13489]: 2023-03-10 06:46:36.315 [WRN] CHBU: Replacing disk backup for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1) w/ newer version
lnd[13489]: 2023-03-10 06:46:36.401 [WRN] CHBU: Replacing disk backup for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1) w/ newer version
lnd[13489]: 2023-03-10 06:46:36.453 [WRN] CHBU: Replacing disk backup for ChannelPoint(3e37d8c38e7a7e2bcd552b0561cd54993c81204f276e9f0f998bce856f9420c1:1) w/ newer version```
AbelLykens commented 1 year ago

@guggero suggested a restart. No change; both sides still have the channel in pendingchannels, but no txn for the channel_point (from pendingchannels) in listchaintxns...

AbelLykens commented 1 year ago

I restarted the node, the funds are now 'back' in walletbalance.

@guggero :

yeah, that's probably the restart that made the wallet realize it's not actually spent

The channel is still in pendingchannels though.

For future people reading this:

so what you need to do is to spend that UTXO yourself (easiest is lncli sendcoins --sweepall ) to an address you control, to make sure the channel will never confirm and once you have a confirmation on the "double spend", you can use lncli abandonchannel (abandonchannel is a dangerous command and can lead to loss of funds if used incorrectly - ask in our slack channel if unsure) on the channel. as long as there's a chance the original channel TX can still confirm, that's not safe to use on the receiving end you can do the same, or it will disappear after 2016 blocks automatically if not confirmed

guggero commented 1 year ago

Possibly related to and fixed by https://github.com/lightningnetwork/lnd/pull/7448?

AbelLykens commented 1 year ago

I suppose for #7448 to work, the tx does have to appear in listchaintxns, which in this case it did not?

Not sure how/when/why we could close this ticket if this is the case -- I am a fan of tickets/issues which can be closed at some point....

AbelLykens commented 1 year ago

(New try succeeded)