Commit dadf08f
committed
Let
Previously, we'd require the user to manually call
`process_pending_htlc_forwards` as part of `PendingHTLCsForwardable`
event handling. Here, we rather move this responsibility to
`BackgroundProcessor`, which simplyfies the flow and allows us to
implement reasonable forwarding delays on our side rather than
delegating to users' implementations.
Note this also introduces batching rounds rather than calling
`process_pending_htlc_forwards` individually for each
`PendingHTLCsForwardable` event, which had been unintuitive anyways, as
subsequent `PendingHTLCsForwardable` could lead to overlapping batch
intervals, resulting in the shortest timespan 'winning' every time, as
`process_pending_htlc_forwards` would of course handle all pending HTLCs
at once.BackgroundProcessor drive HTLC forwarding1 parent cb5537e commit dadf08f
File tree
4 files changed
+114
-4
lines changed- lightning-background-processor/src
- lightning/src/ln
4 files changed
+114
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
331 | | - | |
| 335 | + | |
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
| |||
345 | 349 | | |
346 | 350 | | |
347 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
348 | 355 | | |
349 | 356 | | |
350 | 357 | | |
| |||
369 | 376 | | |
370 | 377 | | |
371 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
372 | 392 | | |
373 | 393 | | |
374 | 394 | | |
| |||
523 | 543 | | |
524 | 544 | | |
525 | 545 | | |
| 546 | + | |
526 | 547 | | |
527 | 548 | | |
528 | 549 | | |
529 | 550 | | |
530 | 551 | | |
531 | 552 | | |
| 553 | + | |
532 | 554 | | |
533 | 555 | | |
534 | 556 | | |
| |||
537 | 559 | | |
538 | 560 | | |
539 | 561 | | |
| 562 | + | |
540 | 563 | | |
541 | 564 | | |
542 | 565 | | |
| |||
545 | 568 | | |
546 | 569 | | |
547 | 570 | | |
548 | | - | |
| 571 | + | |
| 572 | + | |
549 | 573 | | |
550 | 574 | | |
551 | 575 | | |
| |||
581 | 605 | | |
582 | 606 | | |
583 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
584 | 614 | | |
585 | 615 | | |
586 | 616 | | |
| |||
863 | 893 | | |
864 | 894 | | |
865 | 895 | | |
| 896 | + | |
866 | 897 | | |
867 | 898 | | |
868 | 899 | | |
| |||
901 | 932 | | |
902 | 933 | | |
903 | 934 | | |
904 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
905 | 941 | | |
906 | 942 | | |
907 | 943 | | |
| |||
912 | 948 | | |
913 | 949 | | |
914 | 950 | | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
915 | 954 | | |
916 | 955 | | |
917 | 956 | | |
| |||
928 | 967 | | |
929 | 968 | | |
930 | 969 | | |
| 970 | + | |
931 | 971 | | |
932 | 972 | | |
933 | 973 | | |
| |||
1051 | 1091 | | |
1052 | 1092 | | |
1053 | 1093 | | |
| 1094 | + | |
1054 | 1095 | | |
1055 | 1096 | | |
1056 | 1097 | | |
| |||
1094 | 1135 | | |
1095 | 1136 | | |
1096 | 1137 | | |
1097 | | - | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1098 | 1145 | | |
1099 | 1146 | | |
1100 | 1147 | | |
| |||
1107 | 1154 | | |
1108 | 1155 | | |
1109 | 1156 | | |
| 1157 | + | |
1110 | 1158 | | |
1111 | 1159 | | |
1112 | 1160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6318 | 6318 | | |
6319 | 6319 | | |
6320 | 6320 | | |
| 6321 | + | |
| 6322 | + | |
| 6323 | + | |
| 6324 | + | |
| 6325 | + | |
| 6326 | + | |
| 6327 | + | |
| 6328 | + | |
| 6329 | + | |
| 6330 | + | |
| 6331 | + | |
| 6332 | + | |
| 6333 | + | |
| 6334 | + | |
| 6335 | + | |
6321 | 6336 | | |
6322 | 6337 | | |
6323 | 6338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1328 | 1328 | | |
1329 | 1329 | | |
1330 | 1330 | | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1331 | 1342 | | |
1332 | 1343 | | |
1333 | 1344 | | |
| |||
0 commit comments