Skip to content
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

lnsweep: anchor channels with several HTLCs are not handled correctly #9324

Open
ecdsa opened this issue Nov 28, 2024 · 0 comments
Open

lnsweep: anchor channels with several HTLCs are not handled correctly #9324

ecdsa opened this issue Nov 28, 2024 · 0 comments
Assignees
Milestone

Comments

@ecdsa
Copy link
Member

ecdsa commented Nov 28, 2024

If a channel has anchors, lnsweep creates a first-stage htlc tx for each htlc, which includes a UTXOs from the wallet. If the commitment tx has several htlcs, we currently reuse the same UTXO in all htlc transactions, because it is still 'unspent' when we loop over htlcs. This can be tested in various regtests by forcing the client to perform a MPP:

+    $alice setconfig test_force_disable_mpp false
+    $alice setconfig test_force_mpp true

Instead of calling wallet methods from lnsweep, we should delegate the creation of the htlc tx to the wallet.
This could be achieved by extending the "batch payment manager" in #9298.

Instead of being payment driven, the payment manager should accept 3 types of requests:

  • include a given output (for payment requests)
  • include a given input (sweep to the wallet). (we need that in order to CPFP anchor outputs)
  • include a given input and a given output (we need that in order to include zero-fee first-stage htlc transactions)
@ecdsa ecdsa self-assigned this Nov 28, 2024
@ecdsa ecdsa added this to the 4.6.0 milestone Nov 28, 2024
@spesmilo spesmilo deleted a comment from Parkeragan Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant