Commit d8a5839
committed
Track anchor reserves for unresolved monitors
Anchor reserve accounting only looked at channels returned by the
ChannelManager. That misses an important force-close transition:
ChannelManager::list_channels can stop returning a channel before
its commitment transaction confirms. During that window the
ChannelMonitor can still broadcast, rebroadcast, or fee-bump the
holder commitment and its anchor spend, so the wallet's emergency
reserve must remain available.
We now require a anchor reserve to be kept for non-trusted channels
where the type is not yet known; we've recently made anchor channels
always supported in ldk-node, so at this point it is safe to assume most
channels of ldk-node will be anchor channels.
We now no longer count existing 0FC channels to validate support
for submitpackage on the chain source if those channels are in the
trusted peers list.
Co-Authored-By: HAL 90001 parent 7830a16 commit d8a5839
9 files changed
Lines changed: 298 additions & 73 deletions
File tree
- bindings
- kotlin/ldk-node-jvm/lib/src/test/kotlin/org/lightningdevkit/ldknode
- python/src/ldk_node
- src
- liquidity
- service
- payment
- tests/common
Lines changed: 59 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
58 | 92 | | |
59 | 93 | | |
60 | 94 | | |
| |||
77 | 111 | | |
78 | 112 | | |
79 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
80 | 131 | | |
81 | 132 | | |
82 | 133 | | |
| |||
251 | 302 | | |
252 | 303 | | |
253 | 304 | | |
254 | | - | |
255 | | - | |
| 305 | + | |
| 306 | + | |
256 | 307 | | |
257 | 308 | | |
258 | 309 | | |
| 310 | + | |
| 311 | + | |
259 | 312 | | |
260 | 313 | | |
261 | 314 | | |
| |||
316 | 369 | | |
317 | 370 | | |
318 | 371 | | |
| 372 | + | |
| 373 | + | |
319 | 374 | | |
320 | 375 | | |
321 | 376 | | |
322 | 377 | | |
323 | 378 | | |
| 379 | + | |
| 380 | + | |
324 | 381 | | |
325 | 382 | | |
326 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
| |||
175 | 195 | | |
176 | 196 | | |
177 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
178 | 221 | | |
179 | 222 | | |
180 | 223 | | |
| |||
307 | 350 | | |
308 | 351 | | |
309 | 352 | | |
| 353 | + | |
| 354 | + | |
310 | 355 | | |
311 | 356 | | |
312 | 357 | | |
313 | 358 | | |
314 | 359 | | |
| 360 | + | |
| 361 | + | |
315 | 362 | | |
316 | 363 | | |
317 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| 2106 | + | |
2106 | 2107 | | |
2107 | 2108 | | |
2108 | 2109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
| 534 | + | |
533 | 535 | | |
534 | 536 | | |
535 | 537 | | |
| |||
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
| 571 | + | |
569 | 572 | | |
570 | 573 | | |
571 | 574 | | |
| |||
1276 | 1279 | | |
1277 | 1280 | | |
1278 | 1281 | | |
| 1282 | + | |
1279 | 1283 | | |
1280 | 1284 | | |
1281 | 1285 | | |
| |||
0 commit comments