Skip to content

LSPS4 Splicing #12

Merged
amackillop merged 3 commits into
lsp-0.2.0from
feature/lsps4-splice-in
Apr 1, 2026
Merged

LSPS4 Splicing #12
amackillop merged 3 commits into
lsp-0.2.0from
feature/lsps4-splice-in

Conversation

@amackillop
Copy link
Copy Markdown

@amackillop amackillop commented Apr 1, 2026

Instead of always opening new channels when outbound capacity is
insufficient, prefer splicing into the largest existing usable channel.
Falls back to new channel open when no usable channels exist.

Key changes:

  • Add SpliceChannel event variant to LSPS4ServiceEvent
  • Add per-peer liquidity_cooldown to prevent 1Hz retry loops
  • Modify calculate_htlc_actions_for_peer to prefer splice over new channel
  • Add cooldown checks in execute_htlc_actions and process_pending_htlcs
  • Clear cooldown on channel_ready (covers both splice-lock and new channel)

Instead of always opening new channels when outbound capacity is
insufficient, prefer splicing into the largest existing usable channel.
Falls back to new channel open when no usable channels exist.

Key changes:
- Add SpliceChannel event variant to LSPS4ServiceEvent
- Add per-peer liquidity_cooldown to prevent 1Hz retry loops
- Modify calculate_htlc_actions_for_peer to prefer splice over new channel
- Add cooldown checks in execute_htlc_actions and process_pending_htlcs
- Clear cooldown on channel_ready (covers both splice-lock and new channel)
Use is_channel_ready instead of is_usable when selecting splice
candidates. This ensures we prefer splice over new channel even
during channel_reestablish (~1s window). splice_channel() will
fail with "pending open/close" if the channel isn't usable yet,
and the timer retries once reestablishment completes.
@amackillop amackillop merged commit b89fc71 into lsp-0.2.0 Apr 1, 2026
12 of 43 checks passed
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.

2 participants