Commit 4ee3ef1
Split DiscardFunding from SpliceFailed event
When a splice fails, users need to reclaim UTXOs they contributed to the
funding transaction. Previously, the contributed inputs and outputs were
included in the SpliceFailed event. This commit splits them into a
separate DiscardFunding event with a new FundingInfo::Contribution
variant, providing a consistent interface for UTXO cleanup across all
funding failure scenarios.
Changes:
- Add FundingInfo::Contribution variant to hold inputs/outputs for
DiscardFunding events
- Remove contributed_inputs/outputs fields from SpliceFailed event
- Add QuiescentError enum for better error handling in funding_contributed
- Emit DiscardFunding on all funding_contributed error paths
- Filter duplicate inputs/outputs when contribution overlaps existing
pending contribution
- Return Err(APIError) from funding_contributed on all error cases
- Add comprehensive test coverage for funding_contributed error paths
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 0c5cc5e commit 4ee3ef1
6 files changed
Lines changed: 667 additions & 78 deletions
File tree
- lightning/src
- events
- ln
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| |||
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
1580 | 1591 | | |
1581 | 1592 | | |
1582 | 1593 | | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | 1594 | | |
1588 | 1595 | | |
1589 | 1596 | | |
| |||
2378 | 2385 | | |
2379 | 2386 | | |
2380 | 2387 | | |
2381 | | - | |
2382 | | - | |
2383 | 2388 | | |
2384 | 2389 | | |
2385 | 2390 | | |
| |||
2388 | 2393 | | |
2389 | 2394 | | |
2390 | 2395 | | |
2391 | | - | |
2392 | | - | |
2393 | 2396 | | |
2394 | 2397 | | |
2395 | 2398 | | |
| |||
3015 | 3018 | | |
3016 | 3019 | | |
3017 | 3020 | | |
3018 | | - | |
3019 | | - | |
3020 | 3021 | | |
3021 | 3022 | | |
3022 | 3023 | | |
| |||
3025 | 3026 | | |
3026 | 3027 | | |
3027 | 3028 | | |
3028 | | - | |
3029 | | - | |
3030 | 3029 | | |
3031 | 3030 | | |
3032 | 3031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2940 | 2940 | | |
2941 | 2941 | | |
2942 | 2942 | | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
2943 | 2972 | | |
2944 | 2973 | | |
2945 | 2974 | | |
| |||
11907 | 11936 | | |
11908 | 11937 | | |
11909 | 11938 | | |
11910 | | - | |
| 11939 | + | |
11911 | 11940 | | |
11912 | 11941 | | |
| 11942 | + | |
| 11943 | + | |
| 11944 | + | |
| 11945 | + | |
| 11946 | + | |
| 11947 | + | |
| 11948 | + | |
| 11949 | + | |
| 11950 | + | |
| 11951 | + | |
| 11952 | + | |
| 11953 | + | |
| 11954 | + | |
| 11955 | + | |
| 11956 | + | |
| 11957 | + | |
| 11958 | + | |
| 11959 | + | |
| 11960 | + | |
| 11961 | + | |
| 11962 | + | |
11913 | 11963 | | |
11914 | 11964 | | |
11915 | 11965 | | |
| |||
11920 | 11970 | | |
11921 | 11971 | | |
11922 | 11972 | | |
11923 | | - | |
| 11973 | + | |
11924 | 11974 | | |
11925 | 11975 | | |
11926 | 11976 | | |
11927 | 11977 | | |
11928 | | - | |
| 11978 | + | |
11929 | 11979 | | |
11930 | 11980 | | |
11931 | | - | |
11932 | | - | |
11933 | | - | |
11934 | | - | |
11935 | | - | |
11936 | | - | |
11937 | | - | |
11938 | | - | |
11939 | | - | |
11940 | | - | |
11941 | | - | |
11942 | | - | |
11943 | | - | |
11944 | | - | |
11945 | | - | |
11946 | | - | |
11947 | | - | |
11948 | | - | |
11949 | | - | |
11950 | | - | |
11951 | | - | |
11952 | | - | |
11953 | | - | |
| 11981 | + | |
11954 | 11982 | | |
11955 | 11983 | | |
11956 | 11984 | | |
| |||
13069 | 13097 | | |
13070 | 13098 | | |
13071 | 13099 | | |
13072 | | - | |
| 13100 | + | |
13073 | 13101 | | |
13074 | 13102 | | |
13075 | 13103 | | |
13076 | 13104 | | |
13077 | | - | |
| 13105 | + | |
13078 | 13106 | | |
13079 | 13107 | | |
13080 | 13108 | | |
13081 | 13109 | | |
13082 | 13110 | | |
13083 | 13111 | | |
13084 | | - | |
| 13112 | + | |
13085 | 13113 | | |
13086 | 13114 | | |
13087 | 13115 | | |
| |||
0 commit comments