Commit b89fc71
LSPS4 Splicing (#12)
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.
---------
Co-authored-by: Martin Saposnic <martinsaposnic@gmail.com>1 parent 55f7619 commit b89fc71
2 files changed
Lines changed: 258 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
66 | 83 | | |
0 commit comments