From 9ff6f29074c85f84c74ec816d70d29281c1ca1a2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 28 Feb 2020 14:35:34 -0500 Subject: [PATCH] Add comment noting that ChannelMonitor events are serialized --- lightning/src/ln/channelmonitor.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lightning/src/ln/channelmonitor.rs b/lightning/src/ln/channelmonitor.rs index f0b5fef0a..1bc8c76b4 100644 --- a/lightning/src/ln/channelmonitor.rs +++ b/lightning/src/ln/channelmonitor.rs @@ -783,6 +783,11 @@ impl Readable for ChannelMonitorUpdateStep { /// /// You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date /// information and are actively monitoring the chain. +/// +/// Pending Events or updated HTLCs which have not yet been read out by +/// get_and_clear_pending_htlcs_updated or get_and_clear_pending_events are serialized to disk and +/// reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events +/// gotten are fully handled before re-serializing the new state. pub struct ChannelMonitor { latest_update_id: u64, commitment_transaction_number_obscure_factor: u64, -- 2.39.5