Skip to content

Commit 53ea21b

Browse files
committed
Add a few notes about deserializing stale ChannelManagers
See diff for more details
1 parent 78d78ac commit 53ea21b

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

0 commit comments

Comments
 (0)