From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:23:18 +0000 (-0700) Subject: Doc Clarity: Handling gaps in persisted ChannelMonitorUpdates X-Git-Tag: v0.0.124-rc1~12^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=29451bf720799468bc4e38248698ad7aa6efb42b;p=rust-lightning 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. --- 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. ///