From 72e500ba5746f414f917e4d96b9ad87e672e64f9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 11 Feb 2021 13:01:07 -0500 Subject: [PATCH] - bindings updates --- lightning-c-bindings/include/lightning.h | 7 +++++++ lightning-c-bindings/src/ln/channelmanager.rs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 509afd2c..3b04fd70 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -3572,6 +3572,13 @@ typedef struct LDKChannelMessageHandler { * 4) Reconnect blocks on your ChannelMonitors. * 5) Move the ChannelMonitors into your local chain::Watch. * 6) Disconnect/connect blocks on the ChannelManager. + * + * Note that because some channels may be closed during deserialization, it is critical that you + * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to + * you. If you deserialize an old ChannelManager (during which force-closure transactions may be + * broadcast), and then later deserialize a newer version of the same ChannelManager (which will + * not force-close the same channels but consider them live), you may end up revoking a state for + * which you've already broadcasted the transaction. */ typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs { /** diff --git a/lightning-c-bindings/src/ln/channelmanager.rs b/lightning-c-bindings/src/ln/channelmanager.rs index 77c6b5ad..a5304ce9 100644 --- a/lightning-c-bindings/src/ln/channelmanager.rs +++ b/lightning-c-bindings/src/ln/channelmanager.rs @@ -779,6 +779,13 @@ type nativeChannelManagerReadArgs = nativeChannelManagerReadArgsImport<'static, /// 4) Reconnect blocks on your ChannelMonitors. /// 5) Move the ChannelMonitors into your local chain::Watch. /// 6) Disconnect/connect blocks on the ChannelManager. +/// +/// Note that because some channels may be closed during deserialization, it is critical that you +/// always deserialize only the latest version of a ChannelManager and ChannelMonitors available to +/// you. If you deserialize an old ChannelManager (during which force-closure transactions may be +/// broadcast), and then later deserialize a newer version of the same ChannelManager (which will +/// not force-close the same channels but consider them live), you may end up revoking a state for +/// which you've already broadcasted the transaction. #[must_use] #[repr(C)] pub struct ChannelManagerReadArgs { -- 2.30.2