Commit 1facb94
committed
fix(lsps4): track channel opens in flight to prevent stuck HTLC loop
When an HTLC arrives for an offline peer, the webhook wakes them up.
On reconnect, peer_connected defers because channels need reestablish.
Once usable, process_pending_htlcs found insufficient capacity but
assumed a channel open was already in flight - with no actual tracking.
Nobody ever opened the channel, causing an infinite retry loop until
the HTLC expired after 45s.
Add channel_opens_in_flight HashSet so process_pending_htlcs can:
- Emit OpenChannel on the first tick when a new channel is needed
- Skip on subsequent ticks while the open is in progress
- Clear the flag on channel_ready or peer_disconnected1 parent eecf53e commit 1facb94
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
470 | 474 | | |
471 | 475 | | |
472 | 476 | | |
| 477 | + | |
| 478 | + | |
473 | 479 | | |
474 | 480 | | |
475 | 481 | | |
| |||
525 | 531 | | |
526 | 532 | | |
527 | 533 | | |
528 | | - | |
529 | | - | |
530 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
531 | 544 | | |
532 | 545 | | |
533 | 546 | | |
534 | | - | |
| 547 | + | |
535 | 548 | | |
536 | 549 | | |
537 | | - | |
| 550 | + | |
538 | 551 | | |
539 | 552 | | |
540 | 553 | | |
| |||
0 commit comments