From 29451bf720799468bc4e38248698ad7aa6efb42b Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:23:18 -0700 Subject: [PATCH] Doc Clarity: Handling gaps in persisted ChannelMonitorUpdates If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. Since, acc. to channel-manager, we have only made progress if all contiguos ChannelMonitorUpdates have been persisted. --- lightning/src/chain/chainmonitor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index 015b3dacf..e9eafa226 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -176,7 +176,9 @@ pub trait Persist { /// If an implementer chooses to persist the updates only, they need to make /// sure that all the updates are applied to the `ChannelMonitors` *before* /// the set of channel monitors is given to the `ChannelManager` - /// deserialization routine. See [`ChannelMonitor::update_monitor`] for + /// deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s, + /// implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them. + /// See [`ChannelMonitor::update_monitor`] for /// applying a monitor update to a monitor. If full `ChannelMonitors` are /// persisted, then there is no need to persist individual updates. /// -- 2.39.5