Skip to content

Commit 86c4bec

Browse files
committed
Re-write ChannelManager summary documentation
1 parent 75d47df commit 86c4bec

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,11 +951,28 @@ where
951951
fn get_cm(&self) -> &ChannelManager<M, T, ES, NS, SP, F, R, L> { self }
952952
}
953953

954-
/// Manager which keeps track of a number of channels and sends messages to the appropriate
955-
/// channel, also tracking HTLC preimages and forwarding onion packets appropriately.
954+
/// A lightning node's channel state machine and payment management logic.
956955
///
957-
/// Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
958-
/// to individual Channels.
956+
/// [`ChannelManager`] is parameterized by a number of components, which in aggregate facilitate
957+
/// sending, forwarding, and receiving payments through lightning channels.
958+
/// - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring of transactions relevant
959+
/// to each channel
960+
/// - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
961+
/// closing channels
962+
/// - [`EntropySource`] for providing random data needed for cryptographic operations
963+
/// - [`NodeSigner`] for cryptographic operations scoped to the node
964+
/// - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
965+
/// - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
966+
/// timely manner
967+
/// - [`Router`] for finding payment paths when initiating and retrying payments
968+
/// - [`Logger`] for logging operational information of varying degrees
969+
///
970+
/// It implements [`ChannelMessageHandler`] to handle off-chain channel activity from peers,
971+
/// [`MessageSendEventsProvider`] to similarly send such messages to peers, and [`EventsProvider`]
972+
/// to generate user-actionable [`Event`]s.
973+
///
974+
/// Additionally, [`ChannelManager`] implements both [`chain::Listen`] and [`chain::Confirm`] for
975+
/// notification of on-chain events.
959976
///
960977
/// # Persistence
961978
///
@@ -1005,6 +1022,7 @@ where
10051022
/// [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
10061023
/// you're using lightning-net-tokio.
10071024
///
1025+
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
10081026
/// [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
10091027
/// [`funding_created`]: msgs::FundingCreated
10101028
/// [`funding_transaction_generated`]: Self::funding_transaction_generated

0 commit comments

Comments
 (0)