Skip to content

Commit 280de80

Browse files
committed
Add a few notes about deserializing stale ChannelManagers
See diff for more details
1 parent 23c3278 commit 280de80

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
@@ -3934,6 +3934,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> Writeable f
39343934
/// 4) Reconnect blocks on your ChannelMonitors.
39353935
/// 5) Move the ChannelMonitors into your local chain::Watch.
39363936
/// 6) Disconnect/connect blocks on the ChannelManager.
3937+
///
3938+
/// Note that because some channels may be closed during deserialization, it is critical that you
3939+
/// always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
3940+
/// you. If you deserialize an old ChannelManager (during which force-closure transactions may be
3941+
/// broadcast), and then later deserialize a newer version of the same ChannelManager (which will
3942+
/// not force-close the same channels but consider them live), you may end up revoking a state for
3943+
/// which you've already broadcasted the transaction.
39373944
pub struct ChannelManagerReadArgs<'a, Signer: 'a + Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
39383945
where M::Target: chain::Watch<Signer>,
39393946
T::Target: BroadcasterInterface,

0 commit comments

Comments
 (0)