-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Handling non-confirmed funding transactions #386
Copy link
Copy link
Labels
P1MUST be fixed or reviewedMUST be fixed or reviewedfundingRelated to the opening of new channels with funding transactions on the blockchainRelated to the opening of new channels with funding transactions on the blockchainintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNsafetyGeneral label for issues/PRs related to the safety of using the softwareGeneral label for issues/PRs related to the safety of using the software
Metadata
Metadata
Assignees
Labels
P1MUST be fixed or reviewedMUST be fixed or reviewedfundingRelated to the opening of new channels with funding transactions on the blockchainRelated to the opening of new channels with funding transactions on the blockchainintermediateIssues suitable for developers moderately familiar with the codebase and LNIssues suitable for developers moderately familiar with the codebase and LNsafetyGeneral label for issues/PRs related to the safety of using the softwareGeneral label for issues/PRs related to the safety of using the software
Issue
During the current funding workflow, the responder should forget the channel if the funding transaction is not confirmed within a reasonable timeout. For
lndthis 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
fundingManagergets restarted while waiting for the funding transaction to confirm. Currently, on restart it will launch agoroutinethat 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.