From: Matt Corallo Date: Thu, 11 Feb 2021 18:01:07 +0000 (-0500) Subject: - bindings updates X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=refs%2Fheads%2F2020-10-java-bindings-base;p=rust-lightning - bindings updates --- diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 509afd2c5..3b04fd70c 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 77c6b5ade..a5304ce95 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 {