Commit d17ce49
committed
Fail HTLCs which were removed from a channel but not persisted
When a channel is force-closed, if a `ChannelMonitor` update is
completed but a `ChannelManager` persist has not yet happened,
HTLCs which were removed in the latest (persisted) `ChannelMonitor`
update will not be failed even though they do not appear in the
commitment transaction which went on chain. This is because the
`ChannelManager` thinks the `ChannelMonitor` is responsible for
them (as it is stale), but the `ChannelMonitor` has no knowledge of
the HTLC at all (as it is not stale).
The fix for this is relatively simple - we need to check for this
specific case and fail back such HTLCs when deserializing a
`ChannelManager`1 parent b589463 commit d17ce49
File tree
3 files changed
+100
-5
lines changed- lightning/src/ln
3 files changed
+100
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5951 | 5951 | | |
5952 | 5952 | | |
5953 | 5953 | | |
5954 | | - | |
| 5954 | + | |
5955 | 5955 | | |
5956 | 5956 | | |
5957 | 5957 | | |
5958 | | - | |
5959 | | - | |
| 5958 | + | |
| 5959 | + | |
| 5960 | + | |
5960 | 5961 | | |
5961 | 5962 | | |
5962 | | - | |
| 5963 | + | |
5963 | 5964 | | |
5964 | 5965 | | |
5965 | 5966 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5728 | 5728 | | |
5729 | 5729 | | |
5730 | 5730 | | |
5731 | | - | |
| 5731 | + | |
5732 | 5732 | | |
5733 | 5733 | | |
5734 | 5734 | | |
| |||
5746 | 5746 | | |
5747 | 5747 | | |
5748 | 5748 | | |
| 5749 | + | |
| 5750 | + | |
| 5751 | + | |
| 5752 | + | |
| 5753 | + | |
| 5754 | + | |
5749 | 5755 | | |
5750 | 5756 | | |
5751 | 5757 | | |
| |||
7206 | 7212 | | |
7207 | 7213 | | |
7208 | 7214 | | |
| 7215 | + | |
| 7216 | + | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
| 7221 | + | |
| 7222 | + | |
| 7223 | + | |
| 7224 | + | |
| 7225 | + | |
| 7226 | + | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
7209 | 7234 | | |
7210 | 7235 | | |
7211 | 7236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
0 commit comments