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
fixup! Add persistent closed channel history and list_closed_channels()
Replace the in-memory set + `insert_or_update` fallback approach with a
fully durable solution for tracking `is_outbound`/`is_announced` flags.
The previous approach stored these flags in ephemeral `HashSet`s that were
seeded from `list_channels()` at startup and consumed on `ChannelClosed`.
A fallback to any existing `ClosedChannelDetails` record was added to
handle `ReplayEvent`, but a gap remained: if `insert_or_update` failed
(returning `ReplayEvent`) and the node restarted before the retry, the
in-memory sets would be empty (closed channels don't appear in
`list_channels()`) and no persisted record would exist yet, causing both
flags to silently default to `falsee`.
Fix this by persisting a `PendingChannelInfo` record (containing
`is_outbound` and `is_announced`) to the KV store at `ChannelPending`
time under a new `pending_channels/` namespace. The `ChannelClosed`
handler now resolves the flags with the following priority:
1. `pending_channel_store` — durable, survives restarts and replays
2. In-memory sets — covers channels opened before this version
3. Existing `ClosedChannelDetails` record — idempotency guard
The `PendingChannelInfo` record is deleted after `event_queue.add_event`
succeeds. It is intentionally kept alive until that point so that any
replay of `ChannelClosed` (e.g. due to a failed `insert_or_update` or
`add_event`) still finds the correct flags in the store.
0 commit comments