Commit d21a356
chanmon_consistency: resolve timelocked HTLCs during settlement
When channels have been force-closed, the 0xff settlement needs to
advance chain height past HTLC cltv_expiry timelocks so that the
OnchainTxHandler releases timelocked HTLC-timeout claim packages for
broadcast. Without this, HTLC-timeout transactions would never be
generated and in-flight HTLCs would remain unresolved.
The settlement advances in two phases of 250 blocks each:
1. Past cltv_expiry: triggers HTLC-timeout tx broadcasts, which the
existing drain-and-confirm loop picks up and confirms on-chain.
2. Past the CSV delay (BREAKDOWN_TIMEOUT=144): allows SpendableOutputs
events to fire for both the to_local output and resolved HTLC
outputs.
Each phase syncs all nodes to the new chain tip and runs
process_all_events\!() to drain all resulting messages, events,
broadcasts, and monitor updates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 15e2359 commit d21a356
1 file changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2890 | 2890 | | |
2891 | 2891 | | |
2892 | 2892 | | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
2893 | 2948 | | |
2894 | 2949 | | |
2895 | 2950 | | |
| |||
0 commit comments