Skip to content

Handling non-confirmed funding transactions #386

@halseth

Description

@halseth

Issue

During the current funding workflow, the responder should forget the channel if the funding transaction is not confirmed within a reasonable timeout. For lnd this timeout is currently set to 288 blocks.

The funder (initiator) of the channel cannot forget about the channel if the funding transaction is broadcast, since he has funded the transaction with coins. Therefore, we should make sure the money is returned to the funder's wallet.

Steps to completion:

  • Prevent the funder from forgetting about the channel if the fundingManager gets restarted while waiting for the funding transaction to confirm. Currently, on restart it will launch a goroutine that will timeout after 288 blocks, but this should only be done for the channel responder.

  • Determine how to reclaim the funds. We can either double spend the input to the funding transaction back into our wallet, or broadcast the commitment transaction and sweep the funds using CPFP.

Extra credits: We might also be able to bump the fee of the funding transaction to get it confirmed, but this would possibly need some more advanced scripting features, due to changing the amounts int the funding tx changes the txid, which the commitment tx relies on.

Metadata

Metadata

Assignees

Labels

P1MUST be fixed or reviewedfundingRelated to the opening of new channels with funding transactions on the blockchainintermediateIssues suitable for developers moderately familiar with the codebase and LNsafetyGeneral label for issues/PRs related to the safety of using the software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions