Skip to content

gl-plugin: Re-enable LSPS2 JIT htlc_accepted hook#733

Open
cdecker wants to merge 1 commit into
mainfrom
breez-lsps-reenable
Open

gl-plugin: Re-enable LSPS2 JIT htlc_accepted hook#733
cdecker wants to merge 1 commit into
mainfrom
breez-lsps-reenable

Conversation

@cdecker

@cdecker cdecker commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Re-enables the client-side LSPS2 JIT htlc_accepted hook in gl-plugin, which was removed in 35446f9 ("gl-plugin: Remove legacy LSPS2 htlc_accepted hook").

The hook amends the incoming onion payload for JIT channel openings so the node accepts an HTLC carrying a reduced amount — the invoice amount minus the LSP opening fee — and forwards the invoice's total_msat downstream.

What's restored

  • libs/gl-plugin/src/lsp.rs — the on_htlc_accepted hook implementation
  • libs/gl-plugin/src/lib.rsmod lsp declaration and .hook("htlc_accepted", lsp::on_htlc_accepted) registration

Intentionally not restored

The dead messages.rs HtlcAccepted* structs and their test that 35446f9 also removed are not brought back — they were unused duplicates superseded by the structs defined in lsp.rs.

Notes

This is a partial revert (JIT acceptance code only). cargo check -p gl-plugin passes.

🤖 Generated with Claude Code

This partially reverts 35446f9
("gl-plugin: Remove legacy LSPS2 htlc_accepted hook"), restoring the
client-side LSPS2 htlc_accepted hook. The hook amends the incoming
onion payload for JIT channel openings so the node accepts an HTLC
carrying a reduced amount (the invoice amount minus the LSP opening
fee) and forwards the invoice's total_msat downstream.

Restores:
- lsp.rs: the htlc_accepted hook implementation
- lib.rs: mod lsp declaration and .hook("htlc_accepted", ...) registration

The dead messages.rs HtlcAccepted* structs and test that 35446f9 also
removed are intentionally left out; they were unused duplicates
superseded by the structs defined in lsp.rs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant