You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: sync chain tip before healing keysend to prevent HTLC timeout force-close
The healing keysend creates an HTLC with cltv_expiry based on the
ChannelManager's best block height. For users offline >24h (all affected
users), the height is stale — the HTLC is already expired by the time
chain sync catches up, causing LDK to force-close the channel
(HTLCsTimedOut). This defeats the entire recovery.
Fix: call sync_lightning_wallet() before sending healing payments. This
updates the ChannelManager's chain tip to the current height so the HTLC
gets a valid CLTV expiry. If sync fails, skip the keysend entirely to
avoid the stale-CLTV force-close — the monitor will heal naturally on
the first real user payment after continuous chain sync starts.
The stale monitor processes blocks during this sync (accepted risk:
Blocktank is trusted, and the monitor's force-synced update_id makes it
"valid" from LDK's perspective — the only concern is counterparty
force-close during the offline period, which Blocktank wouldn't do).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments