Skip to content

Commit 3bd75fb

Browse files
committed
Add a few notes about deserializing stale ChannelManagers
See diff for more details
1 parent aaf7622 commit 3bd75fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,6 +3791,13 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
37913791
/// 4) Reconnect blocks on your ChannelMonitors.
37923792
/// 5) Move the ChannelMonitors into your local chain::Watch.
37933793
/// 6) Disconnect/connect blocks on the ChannelManager.
3794+
///
3795+
/// Note that because some channels may be closed during deserialization, it is critical that you
3796+
/// always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
3797+
/// you. If you deserialize an old ChannelManager (during which force-closure transactions may be
3798+
/// broadcast), and then later deserialize a newer version of the same ChannelManager (which will
3799+
/// not force-close the same channels but consider them live), you may end up revoking a state for
3800+
/// which you've already broadcasted the transaction.
37943801
pub struct ChannelManagerReadArgs<'a, ChanSigner: 'a + ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
37953802
where M::Target: chain::Watch<Keys=ChanSigner>,
37963803
T::Target: BroadcasterInterface,

0 commit comments

Comments
 (0)