@@ -1075,7 +1075,8 @@ impl<'a> CandidateRouteHop<'a> {
1075
1075
}
1076
1076
}
1077
1077
1078
- fn cltv_expiry_delta ( & self ) -> u32 {
1078
+ /// Returns cltv_expiry_delta for this hop.
1079
+ pub fn cltv_expiry_delta ( & self ) -> u32 {
1079
1080
match self {
1080
1081
CandidateRouteHop :: FirstHop { .. } => 0 ,
1081
1082
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . cltv_expiry_delta as u32 ,
@@ -1085,7 +1086,8 @@ impl<'a> CandidateRouteHop<'a> {
1085
1086
}
1086
1087
}
1087
1088
1088
- fn htlc_minimum_msat ( & self ) -> u64 {
1089
+ /// Returns the htlc_minimum_msat for this hop.
1090
+ pub fn htlc_minimum_msat ( & self ) -> u64 {
1089
1091
match self {
1090
1092
CandidateRouteHop :: FirstHop { details, .. } => details. next_outbound_htlc_minimum_msat ,
1091
1093
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . htlc_minimum_msat ,
@@ -1095,7 +1097,8 @@ impl<'a> CandidateRouteHop<'a> {
1095
1097
}
1096
1098
}
1097
1099
1098
- fn fees ( & self ) -> RoutingFees {
1100
+ /// Returns the fees for this hop.
1101
+ pub fn fees ( & self ) -> RoutingFees {
1099
1102
match self {
1100
1103
CandidateRouteHop :: FirstHop { .. } => RoutingFees {
1101
1104
base_msat : 0 , proportional_millionths : 0 ,
@@ -1129,7 +1132,10 @@ impl<'a> CandidateRouteHop<'a> {
1129
1132
}
1130
1133
}
1131
1134
1132
- fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1135
+ /// Returns the id of this hop.
1136
+ /// For `Blinded` and `OneHopBlinded` we return `CandidateHopId::Blinded` because we don't know the channel id.
1137
+ /// For any other option we return `CandidateHopId::Clear` because we know the channel id and the direction.
1138
+ pub fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1133
1139
match self {
1134
1140
CandidateRouteHop :: Blinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
1135
1141
CandidateRouteHop :: OneHopBlinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
@@ -1166,8 +1172,12 @@ impl<'a> CandidateRouteHop<'a> {
1166
1172
}
1167
1173
}
1168
1174
1175
+ /// A wrapper around the various hop id representations.
1176
+ ///
1177
+ /// `CandidateHopId::Clear` is used to identify a hop with a known short channel id and direction.
1178
+ /// `CandidateHopId::Blinded` is used to identify a blinded hop `hint_idx`.
1169
1179
#[ derive( Clone , Copy , Eq , Hash , Ord , PartialOrd , PartialEq ) ]
1170
- enum CandidateHopId {
1180
+ pub enum CandidateHopId {
1171
1181
/// Contains (scid, src_node_id < target_node_id)
1172
1182
Clear ( ( u64 , bool ) ) ,
1173
1183
/// Index of the blinded route hint in [`Payee::Blinded::route_hints`].
0 commit comments