fix(lsps4): trigger channel open at peer_connected even during reestablish#9
Merged
martinsaposnic merged 1 commit intolsp-0.2.0from Mar 20, 2026
Merged
Conversation
fe2e09a to
eecf53e
Compare
…blish When an HTLC arrives for an offline peer, htlc_intercepted stores it and sends a webhook. When the peer reconnects, peer_connected deferred all processing if channels existed but weren't usable yet (reestablish in progress). Later, process_pending_htlcs found insufficient capacity but assumed a channel open was already in flight - nobody ever opened the channel. Fix: call process_htlcs_for_peer even when channels aren't usable. calculate_htlc_actions skips non-usable channels, so if existing capacity is insufficient it returns new_channel_needed_msat and execute_htlc_actions emits OpenChannel. No premature forwarding occurs since the forwards list is empty (no usable channels). The actual HTLC forwards happen via channel_ready once the new channel is established.
d7b97a7 to
2252def
Compare
kitaebot
approved these changes
Mar 20, 2026
martinsaposnic
added a commit
to moneydevkit/ldk-node
that referenced
this pull request
Mar 20, 2026
…en fix Updates rust-lightning rev to include moneydevkit/rust-lightning#9: trigger OpenChannel at peer_connected even during reestablish, fixing stuck HTLC loop when existing channel capacity is insufficient.
1 task
amackillop
pushed a commit
to moneydevkit/ldk-node
that referenced
this pull request
Mar 20, 2026
…en fix (#13) Updates rust-lightning rev to include moneydevkit/rust-lightning#9: trigger OpenChannel at peer_connected even during reestablish, fixing stuck HTLC loop when existing channel capacity is insufficient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
htlc_interceptedstores it and sends a webhook. The peer reconnects, butpeer_connecteddeferred all processing because channels weren't usable yet (reestablish in progress). Later,process_pending_htlcsfound insufficient capacity but assumed a channel open was "already in flight" - nobody ever opened one. The HTLC would loop until expiry (45s) and fail.process_htlcs_for_peereven when channels aren't usable.calculate_htlc_actionsskips non-usable channels, so it correctly returnsnew_channel_needed_msatand emitsOpenChannel. No premature forwarding occurs since the forwards list is empty (no usable channels). Actual HTLC forwards happen viachannel_readyonce the new channel is established.Test plan