Commit c390560
Delay considering a channel closed when seeing an on-chain spend (#2936)
Fixes Issue #2437
When an external channel is spent, add it to the `spentChannels` list instead of immediately removing it from the graph.
RBF attempts can produce multiple spending txs in the mempool for the same channel.
The `spendChannels` list maps the txid of the spending tx to the scid of the spent channel.
When a channel announcement is validated with a funding tx on the `spentChannels` list, consider the new channel a splice of the corresponding spent channel.
A splice updates the graph edges to preserve balance estimate information in the graph.
If a spending tx from the `spentChannels` list is deeply buried before appearing in a valid channel announcement, remove the corresponding spent channel from the graph.
The integration test demonstrates that local channels update their capacity, but we can not test the remote node (carol) because the ChannelAnnouncements are ignored because it has a duplicate scid. After PR #2941 we can fix this test.
---------
Co-authored-by: t-bast <[email protected]>1 parent 61af10a commit c390560
File tree
15 files changed
+566
-141
lines changed- eclair-core/src
- main/scala/fr/acinq/eclair
- blockchain/bitcoind
- channel
- router
- test/scala/fr/acinq/eclair
- blockchain/bitcoind
- integration
- basic
- channel
- fixtures
- router
15 files changed
+566
-141
lines changedLines changed: 9 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 107 | | |
122 | 108 | | |
123 | 109 | | |
| |||
134 | 120 | | |
135 | 121 | | |
136 | 122 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
142 | 126 | | |
143 | 127 | | |
144 | 128 | | |
| |||
197 | 181 | | |
198 | 182 | | |
199 | 183 | | |
200 | | - | |
201 | 184 | | |
202 | 185 | | |
203 | 186 | | |
| |||
245 | 228 | | |
246 | 229 | | |
247 | 230 | | |
248 | | - | |
| 231 | + | |
249 | 232 | | |
250 | 233 | | |
251 | 234 | | |
| |||
339 | 322 | | |
340 | 323 | | |
341 | 324 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | 325 | | |
346 | 326 | | |
347 | 327 | | |
| |||
375 | 355 | | |
376 | 356 | | |
377 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
378 | 363 | | |
379 | 364 | | |
380 | 365 | | |
| |||
390 | 375 | | |
391 | 376 | | |
392 | 377 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 378 | | |
405 | 379 | | |
406 | 380 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
| 808 | + | |
| 809 | + | |
808 | 810 | | |
809 | 811 | | |
810 | 812 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
198 | 210 | | |
199 | 211 | | |
200 | 212 | | |
| |||
263 | 275 | | |
264 | 276 | | |
265 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
266 | 286 | | |
267 | 287 | | |
268 | 288 | | |
| |||
305 | 325 | | |
306 | 326 | | |
307 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
308 | 335 | | |
309 | 336 | | |
310 | 337 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
628 | 636 | | |
629 | 637 | | |
630 | 638 | | |
| |||
678 | 686 | | |
679 | 687 | | |
680 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
681 | 705 | | |
682 | 706 | | |
683 | 707 | | |
| |||
Lines changed: 19 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
262 | | - | |
263 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
264 | 275 | | |
265 | 276 | | |
266 | 277 | | |
| |||
409 | 420 | | |
410 | 421 | | |
411 | 422 | | |
412 | | - | |
| 423 | + | |
413 | 424 | | |
414 | | - | |
| 425 | + | |
415 | 426 | | |
416 | 427 | | |
417 | 428 | | |
| |||
573 | 584 | | |
574 | 585 | | |
575 | 586 | | |
576 | | - | |
577 | 587 | | |
578 | 588 | | |
579 | 589 | | |
| |||
622 | 632 | | |
623 | 633 | | |
624 | 634 | | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | 635 | | |
632 | 636 | | |
633 | 637 | | |
| |||
757 | 761 | | |
758 | 762 | | |
759 | 763 | | |
760 | | - | |
| 764 | + | |
| 765 | + | |
761 | 766 | | |
762 | 767 | | |
763 | 768 | | |
| |||
0 commit comments