Skip to content

Commit a71d8af

Browse files
committed
WIP: Expand ChannelManager documentation
1 parent 86c4bec commit a71d8af

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,37 @@ where
974974
/// Additionally, [`ChannelManager`] implements both [`chain::Listen`] and [`chain::Confirm`] for
975975
/// notification of on-chain events.
976976
///
977+
/// # `ChannelManager` vs `ChannelMonitor`
978+
///
979+
/// It's important to distinguish between the *off-chain* management and *on-chain* monitoring of
980+
/// lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
981+
/// state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
982+
/// and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
983+
/// [`chain::Watch`] of them.
984+
///
985+
/// An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
986+
/// these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
987+
/// for any pertinent on-chain activity, broadcasting claims as needed.
988+
///
989+
/// This division of off-chain management and on-chain monitoring is what allows for interesting
990+
/// node setups. See the [`chain`] module for further details.
991+
///
992+
/// # Initialization
993+
///
994+
/// TODO
995+
///
996+
/// # Operation
997+
///
998+
/// TODO
999+
/// - event processing
1000+
/// - timer ticks
1001+
/// - chain data
1002+
/// - persistence
1003+
///
1004+
/// # Payments
1005+
///
1006+
/// TODO
1007+
///
9771008
/// # Persistence
9781009
///
9791010
/// Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for

0 commit comments

Comments
 (0)