Commit 720bce6
chanmon_consistency: sync stale monitors without lowering node height
The settlement resync (3e576df9a) reset node_height to the minimum of
the node and monitor heights so sync_with_chain_state would re-deliver
missed blocks to stale monitors. However, this also fed those
low-height blocks to the ChannelManager, which interpreted them as the
funding transaction being un-confirmed (get_funding_tx_confirmations
returns 0 when height < funding_tx_confirmation_height). This triggered
spurious force-closes, leading to multiple force-close cycles with
different commitment transactions and stale htlcs_resolved_on_chain
entries that caused an assertion failure in get_htlc_balance.
Fix by syncing stale monitors directly through their ChainMonitor
methods for the missed block range, without touching node_height or
the ChannelManager.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9de0830 commit 720bce6
1 file changed
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2875 | 2875 | | |
2876 | 2876 | | |
2877 | 2877 | | |
2878 | | - | |
2879 | | - | |
2880 | | - | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
2885 | 2886 | | |
2886 | | - | |
| 2887 | + | |
2887 | 2888 | | |
2888 | 2889 | | |
2889 | | - | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
2890 | 2906 | | |
| 2907 | + | |
2891 | 2908 | | |
2892 | | - | |
2893 | 2909 | | |
2894 | 2910 | | |
2895 | 2911 | | |
| |||
0 commit comments