lightninglabs / chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
MIT License
222 stars 32 forks source link

Recover Pending Channel from RBF (new transaction) #96

Closed atomantic closed 11 months ago

atomantic commented 11 months ago

I think I'm experiencing a bug that would be great to have a tool to address--and, please, correct me if this is not a workable solution (I'm new to this).

I have a pending channel that was sitting for about 12 hours with too low of an on-chain fee. Before realizing that I could use lncli to bumpfee, I broadcasted a new RBF transaction manually. My LND node is still waiting for the original (non-replaced) txn to complete, even though it's been successfully processed with a new txn via RBF. It would appear that this could be patched if I could just update the channel_point in the pending channels list to point to the new txn that replaced the old one.

Is this something that chantools could provide? And does that make sense as a possible workaround to the node not recognizing that the txn was replaced by fee?

I don't want to go mucking around the postgress since it appears via lncli that channel_point is the unique ID for referencing edits using commands like updatechanpolicy -- so I don't want to get in a worse situation than it's already in :)

atomantic commented 11 months ago

After reading more on this it appears that RBF is not a valid way to increase fees for channel opens. At this point, since it's confirmed onchain, I'm listening to the section on what I should never do and avoiding abandonchannel--so what's the best recovery here?

guggero commented 11 months ago

See my comment here: https://github.com/lightningnetwork/lnd/discussions/8208#discussioncomment-7622190 chantools already has everything you need to rescue the funds, but you'll need to get a signature from your peer which might be the hard part.

You can use lncli abandonchannel on your node, as the channel will definitely never become operational.