Skip to content

Commit f998e71

Browse files
committed
Re-write ChannelManager summary documentation
1 parent 9b60d7c commit f998e71

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,31 @@ where
11091109
fn get_cm(&self) -> &ChannelManager<M, T, ES, NS, SP, F, R, L> { self }
11101110
}
11111111

1112-
/// Manager which keeps track of a number of channels and sends messages to the appropriate
1113-
/// channel, also tracking HTLC preimages and forwarding onion packets appropriately.
1112+
/// A lightning node's channel state machine and payment management logic, which facilitates
1113+
/// sending, forwarding, and receiving payments through lightning channels.
11141114
///
1115-
/// Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
1116-
/// to individual Channels.
1115+
/// [`ChannelManager`] is parameterized by a number of components to achieve this.
1116+
/// - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
1117+
/// channel
1118+
/// - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
1119+
/// closing channels
1120+
/// - [`EntropySource`] for providing random data needed for cryptographic operations
1121+
/// - [`NodeSigner`] for cryptographic operations scoped to the node
1122+
/// - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
1123+
/// - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
1124+
/// timely manner
1125+
/// - [`Router`] for finding payment paths when initiating and retrying payments
1126+
/// - [`Logger`] for logging operational information of varying degrees
1127+
///
1128+
/// Additionally, it implements the following traits:
1129+
/// - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
1130+
/// - [`MessageSendEventsProvider`] to similarly send such messages to peers
1131+
/// - [`OffersMessageHandler`] for BOLT 12 message handling and sending
1132+
/// - [`EventsProvider`] to generate user-actionable [`Event`]s
1133+
/// - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
1134+
///
1135+
/// Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
1136+
/// [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11171137
///
11181138
/// # Persistence
11191139
///
@@ -1163,6 +1183,9 @@ where
11631183
/// [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
11641184
/// you're using lightning-net-tokio.
11651185
///
1186+
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
1187+
/// [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
1188+
/// [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
11661189
/// [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
11671190
/// [`funding_created`]: msgs::FundingCreated
11681191
/// [`funding_transaction_generated`]: Self::funding_transaction_generated

0 commit comments

Comments
 (0)