Skip to content

Commit 6ae0516

Browse files
committed
Make CandidateRouteHop method docs somewhat more descriptive
1 parent e9bad1b commit 6ae0516

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
@@ -1138,7 +1138,11 @@ impl<'a> CandidateRouteHop<'a> {
11381138
}
11391139
}
11401140

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

1153-
/// Returns the htlc_minimum_msat for this hop.
1157+
/// Returns the minimum amount that can be sent over this hop, in millisatoshis.
11541158
#[inline]
11551159
pub fn htlc_minimum_msat(&self) -> u64 {
11561160
match self {
@@ -1162,7 +1166,7 @@ impl<'a> CandidateRouteHop<'a> {
11621166
}
11631167
}
11641168

1165-
/// Returns the fees for this hop.
1169+
/// Returns the fees that must be paid to route an HTLC over this channel.
11661170
#[inline]
11671171
pub fn fees(&self) -> RoutingFees {
11681172
match self {
@@ -1219,9 +1223,9 @@ impl<'a> CandidateRouteHop<'a> {
12191223
}
12201224
/// Returns the source node id of current hop.
12211225
///
1222-
/// Source node id refers to the hop forwarding the payment.
1226+
/// Source node id refers to the node forwarding the HTLC through this hop.
12231227
///
1224-
/// For `FirstHop` we return payer's node id.
1228+
/// For [`Self::FirstHop`] we return payer's node id.
12251229
#[inline]
12261230
pub fn source(&self) -> NodeId {
12271231
match self {
@@ -1234,9 +1238,13 @@ impl<'a> CandidateRouteHop<'a> {
12341238
}
12351239
/// Returns the target node id of this hop, if known.
12361240
///
1237-
/// Target node id refers to the hop receiving the payment.
1241+
/// Target node id refers to the node receiving the HTLC after this hop.
1242+
///
1243+
/// For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
1244+
/// path is unknown.
12381245
///
1239-
/// For `Blinded` and `OneHopBlinded` we return `None` because next hop is blinded.
1246+
/// For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
1247+
/// and such a return value would be somewhat nonsensical.
12401248
#[inline]
12411249
pub fn target(&self) -> Option<NodeId> {
12421250
match self {

0 commit comments

Comments
 (0)