File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1135,6 +1135,22 @@ where
1135
1135
/// Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
1136
1136
/// [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
1137
1137
///
1138
+ /// # `ChannelManager` vs `ChannelMonitor`
1139
+ ///
1140
+ /// It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
1141
+ /// lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
1142
+ /// state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
1143
+ /// and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
1144
+ /// [`chain::Watch`] of them.
1145
+ ///
1146
+ /// An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
1147
+ /// these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
1148
+ /// for any pertinent on-chain activity, enforcing claims as needed.
1149
+ ///
1150
+ /// This division of off-chain management and on-chain enforcement allows for interesting node
1151
+ /// setups. For instance, on-chain enforcement could be moved to a separate host or have added
1152
+ /// redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
1153
+ ///
1138
1154
/// # Persistence
1139
1155
///
1140
1156
/// Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
You can’t perform that action at this time.
0 commit comments