Commit 2252def
committed
fix(lsps4): trigger channel open at peer_connected even during reestablish
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.1 parent eecf53e commit 2252def
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
395 | 401 | | |
396 | 402 | | |
397 | | - | |
398 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
399 | 406 | | |
400 | 407 | | |
| 408 | + | |
401 | 409 | | |
402 | 410 | | |
403 | 411 | | |
| |||
0 commit comments