Commit 0344807
committed
Hold back HTLC mon events while updates in-progress
Recently, we began generating monitor events when HTLCs fail
off-chain. In upcoming commits, we'll begin relying on those events
to resolve forwarded HTLC fails on the inbound edge.
One requirement for that is that we can't fail an HTLC backwards from a monitor
event until the monitor update removing that HTLC on the outbound edge is
durably persisted. Otherwise, if we crash and lose that monitor update at the
wrong time, the outbound edge counterparty could theoretically change their
fail resolution to a claim and we'd have no recourse because we already failed
the HTLC back on the inbound edge.
As such, here we begin not surfacing HTLC-related monitor events to the
ChannelManager if there are in-flight monitor updates present, to prevent this
scenario.1 parent 43999b4 commit 0344807
3 files changed
Lines changed: 72 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
832 | 835 | | |
833 | 836 | | |
834 | 837 | | |
| |||
1646 | 1649 | | |
1647 | 1650 | | |
1648 | 1651 | | |
1649 | | - | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1650 | 1666 | | |
1651 | 1667 | | |
1652 | 1668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2361 | 2361 | | |
2362 | 2362 | | |
2363 | 2363 | | |
2364 | | - | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
2365 | 2375 | | |
2366 | 2376 | | |
2367 | 2377 | | |
| |||
4937 | 4947 | | |
4938 | 4948 | | |
4939 | 4949 | | |
4940 | | - | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
| 4966 | + | |
4941 | 4967 | | |
4942 | | - | |
4943 | | - | |
4944 | | - | |
4945 | | - | |
4946 | | - | |
4947 | | - | |
4948 | | - | |
4949 | | - | |
| 4968 | + | |
4950 | 4969 | | |
| 4970 | + | |
4951 | 4971 | | |
4952 | 4972 | | |
4953 | 4973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5553 | 5553 | | |
5554 | 5554 | | |
5555 | 5555 | | |
5556 | | - | |
5557 | | - | |
5558 | | - | |
5559 | | - | |
5560 | | - | |
5561 | | - | |
5562 | | - | |
5563 | | - | |
5564 | | - | |
| 5556 | + | |
| 5557 | + | |
5565 | 5558 | | |
5566 | 5559 | | |
5567 | 5560 | | |
| |||
5593 | 5586 | | |
5594 | 5587 | | |
5595 | 5588 | | |
5596 | | - | |
5597 | | - | |
5598 | | - | |
5599 | | - | |
| 5589 | + | |
| 5590 | + | |
| 5591 | + | |
| 5592 | + | |
| 5593 | + | |
| 5594 | + | |
| 5595 | + | |
| 5596 | + | |
| 5597 | + | |
| 5598 | + | |
| 5599 | + | |
| 5600 | + | |
| 5601 | + | |
| 5602 | + | |
| 5603 | + | |
5600 | 5604 | | |
5601 | | - | |
| 5605 | + | |
| 5606 | + | |
| 5607 | + | |
| 5608 | + | |
| 5609 | + | |
| 5610 | + | |
| 5611 | + | |
5602 | 5612 | | |
5603 | 5613 | | |
5604 | 5614 | | |
| |||
0 commit comments