Commit fdc2077
authored
Refactor replaceable transactions (#3075)
We previously included confirmation targets directly in HTLC and anchor
transactions, which didn't really belong there. We now instead set
confirmation targets at publication time, based on the current state of
the force-close attempt.
We also extract witness data for HTLCs (preimage and remote signature)
when creating the command to publish the transaction, instead of doing
it inside the publisher actors.
We improve the checks done in the pre-publisher actors, which now take
into account the min-depth for commit txs before aborting anchor txs.
The `ReplaceableTxFunder` is also simpler now, thanks to a better
encapsulation of the transaction's contents.
We didn't watch our anchor output on the remote commit, which means we
weren't recording in the `AuditDB` the fees we paid to get a remote
commit tx confirmed by spending our anchor output. We only had that
code for the local commit, but we've recently started more aggressively
trying to get the *remote* commitment confirmed, so it's important to
correctly record those fees.1 parent f14b92d commit fdc2077
File tree
31 files changed
+962
-1051
lines changed- eclair-core/src
- main/scala/fr/acinq/eclair
- channel
- fsm
- publish
- transactions
- wire/internal/channel
- version2
- version3
- version4
- test/scala/fr/acinq/eclair
- balance
- channel
- publish
- states
- c
- e
- f
- h
- payment
- transactions
- wire/internal/channel/version3
31 files changed
+962
-1051
lines changedLines changed: 38 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
334 | | - | |
| 332 | + | |
335 | 333 | | |
336 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
337 | 352 | | |
338 | 353 | | |
339 | 354 | | |
| |||
363 | 378 | | |
364 | 379 | | |
365 | 380 | | |
366 | | - | |
367 | | - | |
368 | | - | |
| 381 | + | |
369 | 382 | | |
370 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
371 | 401 | | |
372 | 402 | | |
373 | 403 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
| |||
255 | 268 | | |
256 | 269 | | |
257 | 270 | | |
| 271 | + | |
258 | 272 | | |
259 | 273 | | |
260 | 274 | | |
| |||
735 | 749 | | |
736 | 750 | | |
737 | 751 | | |
| 752 | + | |
738 | 753 | | |
739 | 754 | | |
740 | 755 | | |
| |||
Lines changed: 10 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | 853 | | |
873 | 854 | | |
874 | 855 | | |
| |||
900 | 881 | | |
901 | 882 | | |
902 | 883 | | |
903 | | - | |
904 | | - | |
905 | | - | |
| 884 | + | |
906 | 885 | | |
907 | 886 | | |
908 | 887 | | |
909 | 888 | | |
910 | 889 | | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
919 | 893 | | |
| 894 | + | |
920 | 895 | | |
921 | 896 | | |
922 | 897 | | |
| |||
1015 | 990 | | |
1016 | 991 | | |
1017 | 992 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
| 993 | + | |
1021 | 994 | | |
1022 | 995 | | |
1023 | 996 | | |
1024 | 997 | | |
1025 | 998 | | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
1034 | 1002 | | |
| 1003 | + | |
1035 | 1004 | | |
1036 | 1005 | | |
1037 | 1006 | | |
| |||
Lines changed: 23 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
2168 | 2168 | | |
2169 | 2169 | | |
2170 | 2170 | | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2174 | 2186 | | |
2175 | | - | |
2176 | | - | |
| 2187 | + | |
| 2188 | + | |
2177 | 2189 | | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
| 2190 | + | |
| 2191 | + | |
2181 | 2192 | | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
| 2193 | + | |
| 2194 | + | |
2185 | 2195 | | |
2186 | | - | |
2187 | 2196 | | |
2188 | 2197 | | |
2189 | 2198 | | |
2190 | | - | |
2191 | 2199 | | |
| 2200 | + | |
2192 | 2201 | | |
2193 | 2202 | | |
2194 | 2203 | | |
| |||
0 commit comments