Commit dbc5bf8
authored
fix: rescale HTLC in-flight caps on splice promotion (#17)
When a splice promotes a new FundingScope, `holder_max_htlc_value_in_flight_msat`
and `counterparty_max_htlc_value_in_flight_msat` stay pinned at their pre-splice
values instead of scaling with the new channel capacity. Any HTLC larger than
the pre-splice cap is rejected:
- on the sender with HTLCMaximum inside send_htlc
- on the receiver with "Remote HTLC add would put them over our max HTLC
value", which force-closes the channel
Both manifestations break LSPS4 JIT splice flows where the client's embedded
node first opens a small JIT channel, then splices in capacity when a larger
payment arrives. The receiver force-close is particularly damaging because
it destroys the channel along with any pending fees.
Rescale both caps proportionally to the channel-value change on splice
promotion. Also tightens the test_splice_in assertions (the previous check
compared msats to sats).1 parent 070b31d commit dbc5bf8
2 files changed
Lines changed: 50 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6443 | 6443 | | |
6444 | 6444 | | |
6445 | 6445 | | |
| 6446 | + | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
| 6453 | + | |
| 6454 | + | |
| 6455 | + | |
| 6456 | + | |
| 6457 | + | |
| 6458 | + | |
6446 | 6459 | | |
6447 | 6460 | | |
6448 | 6461 | | |
| |||
11185 | 11198 | | |
11186 | 11199 | | |
11187 | 11200 | | |
| 11201 | + | |
11188 | 11202 | | |
11189 | 11203 | | |
11190 | 11204 | | |
11191 | 11205 | | |
11192 | 11206 | | |
11193 | 11207 | | |
| 11208 | + | |
| 11209 | + | |
| 11210 | + | |
| 11211 | + | |
| 11212 | + | |
| 11213 | + | |
| 11214 | + | |
| 11215 | + | |
| 11216 | + | |
| 11217 | + | |
| 11218 | + | |
| 11219 | + | |
| 11220 | + | |
| 11221 | + | |
| 11222 | + | |
| 11223 | + | |
| 11224 | + | |
| 11225 | + | |
| 11226 | + | |
| 11227 | + | |
| 11228 | + | |
| 11229 | + | |
| 11230 | + | |
| 11231 | + | |
| 11232 | + | |
| 11233 | + | |
| 11234 | + | |
| 11235 | + | |
11194 | 11236 | | |
11195 | 11237 | | |
11196 | 11238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
763 | | - | |
764 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
769 | | - | |
770 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
771 | 773 | | |
772 | 774 | | |
773 | 775 | | |
| |||
0 commit comments