Skip to content

Commit 0f02feb

Browse files
committed
Make CandidateRouteHop method docs somewhat more descriptive
1 parent c76043b commit 0f02feb

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

lightning/src/routing/router.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,11 @@ impl<'a> CandidateRouteHop<'a> {
11371137
}
11381138
}
11391139

1140-
/// Returns cltv_expiry_delta for this hop.
1140+
/// Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
1141+
/// next-hop for an HTLC taking this hop.
1142+
///
1143+
/// This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
1144+
/// next-hop goes on chain with a payment preimage.
11411145
#[inline]
11421146
pub fn cltv_expiry_delta(&self) -> u32 {
11431147
match self {
@@ -1149,7 +1153,7 @@ impl<'a> CandidateRouteHop<'a> {
11491153
}
11501154
}
11511155

1152-
/// Returns the htlc_minimum_msat for this hop.
1156+
/// Returns the minimum amount which can be sent over this hop, in millisatoshis.
11531157
#[inline]
11541158
pub fn htlc_minimum_msat(&self) -> u64 {
11551159
match self {
@@ -1161,7 +1165,7 @@ impl<'a> CandidateRouteHop<'a> {
11611165
}
11621166
}
11631167

1164-
/// Returns the fees for this hop.
1168+
/// Returns the fees which must be paid to route an HTLC over this channel.
11651169
#[inline]
11661170
pub fn fees(&self) -> RoutingFees {
11671171
match self {
@@ -1218,9 +1222,9 @@ impl<'a> CandidateRouteHop<'a> {
12181222
}
12191223
/// Returns the source node id of current hop.
12201224
///
1221-
/// Source node id refers to the hop forwarding the payment.
1225+
/// Source node id refers to the node forwarding the HTLC through this hop.
12221226
///
1223-
/// For `FirstHop` we return payer's node id.
1227+
/// For [`Self::FirstHop`] we return payer's node id.
12241228
#[inline]
12251229
pub fn source(&self) -> NodeId {
12261230
match self {
@@ -1233,9 +1237,13 @@ impl<'a> CandidateRouteHop<'a> {
12331237
}
12341238
/// Returns the target node id of this hop, if known.
12351239
///
1236-
/// Target node id refers to the hop receiving the payment.
1240+
/// Target node id refers to the node receiving the HTLC after this hop.
1241+
///
1242+
/// For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
1243+
/// path is unknown.
12371244
///
1238-
/// For `Blinded` and `OneHopBlinded` we return `None` because next hop is blinded.
1245+
/// For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
1246+
/// and such a return value would be somewhat nonsensical.
12391247
#[inline]
12401248
pub fn target(&self) -> Option<NodeId> {
12411249
match self {

0 commit comments

Comments
 (0)