From: Matt Corallo Date: Fri, 28 Feb 2020 19:35:34 +0000 (-0500) Subject: Add comment noting that ChannelMonitor events are serialized X-Git-Tag: v0.0.12~115^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=9ff6f29074c85f84c74ec816d70d29281c1ca1a2;p=rust-lightning Add comment noting that ChannelMonitor events are serialized --- 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,