Skip to content

Commit a8cc623

Browse files
committed
Re-write ChannelManager summary documentation
1 parent df97db8 commit a8cc623

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
@@ -1068,11 +1068,28 @@ where
10681068
fn get_cm(&self) -> &ChannelManager<M, T, ES, NS, SP, F, R, L> { self }
10691069
}
10701070

1071-
/// Manager which keeps track of a number of channels and sends messages to the appropriate
1072-
/// channel, also tracking HTLC preimages and forwarding onion packets appropriately.
1071+
/// A lightning node's channel state machine and payment management logic.
10731072
///
1074-
/// Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
1075-
/// to individual Channels.
1073+
/// [`ChannelManager`] is parameterized by a number of components, which in aggregate facilitate
1074+
/// sending, forwarding, and receiving payments through lightning channels.
1075+
/// - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring of transactions relevant
1076+
/// to each channel
1077+
/// - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
1078+
/// closing channels
1079+
/// - [`EntropySource`] for providing random data needed for cryptographic operations
1080+
/// - [`NodeSigner`] for cryptographic operations scoped to the node
1081+
/// - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
1082+
/// - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
1083+
/// timely manner
1084+
/// - [`Router`] for finding payment paths when initiating and retrying payments
1085+
/// - [`Logger`] for logging operational information of varying degrees
1086+
///
1087+
/// It implements [`ChannelMessageHandler`] to handle off-chain channel activity from peers,
1088+
/// [`MessageSendEventsProvider`] to similarly send such messages to peers, and [`EventsProvider`]
1089+
/// to generate user-actionable [`Event`]s.
1090+
///
1091+
/// Additionally, [`ChannelManager`] implements both [`chain::Listen`] and [`chain::Confirm`] for
1092+
/// notification of on-chain events.
10761093
///
10771094
/// # Persistence
10781095
///
@@ -1122,6 +1139,7 @@ where
11221139
/// [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
11231140
/// you're using lightning-net-tokio.
11241141
///
1142+
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11251143
/// [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
11261144
/// [`funding_created`]: msgs::FundingCreated
11271145
/// [`funding_transaction_generated`]: Self::funding_transaction_generated

0 commit comments

Comments
 (0)