@@ -1065,7 +1065,8 @@ impl<'a> CandidateRouteHop<'a> {
1065
1065
}
1066
1066
}
1067
1067
1068
- fn cltv_expiry_delta ( & self ) -> u32 {
1068
+ /// Returns cltv_expiry_delta for this hop.
1069
+ pub fn cltv_expiry_delta ( & self ) -> u32 {
1069
1070
match self {
1070
1071
CandidateRouteHop :: FirstHop { .. } => 0 ,
1071
1072
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . cltv_expiry_delta as u32 ,
@@ -1075,7 +1076,8 @@ impl<'a> CandidateRouteHop<'a> {
1075
1076
}
1076
1077
}
1077
1078
1078
- fn htlc_minimum_msat ( & self ) -> u64 {
1079
+ /// Returns the htlc_minimum_msat for this hop.
1080
+ pub fn htlc_minimum_msat ( & self ) -> u64 {
1079
1081
match self {
1080
1082
CandidateRouteHop :: FirstHop { details, .. } => details. next_outbound_htlc_minimum_msat ,
1081
1083
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . htlc_minimum_msat ,
@@ -1085,7 +1087,8 @@ impl<'a> CandidateRouteHop<'a> {
1085
1087
}
1086
1088
}
1087
1089
1088
- fn fees ( & self ) -> RoutingFees {
1090
+ /// Returns the fees for this hop.
1091
+ pub fn fees ( & self ) -> RoutingFees {
1089
1092
match self {
1090
1093
CandidateRouteHop :: FirstHop { .. } => RoutingFees {
1091
1094
base_msat : 0 , proportional_millionths : 0 ,
@@ -1119,7 +1122,10 @@ impl<'a> CandidateRouteHop<'a> {
1119
1122
}
1120
1123
}
1121
1124
1122
- fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1125
+ /// Returns the id of this hop.
1126
+ /// For `Blinded` and `OneHopBlinded` we return `CandidateHopId::Blinded` because we don't know the channel id.
1127
+ /// For any other option we return `CandidateHopId::Clear` because we know the channel id and the direction.
1128
+ pub fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1123
1129
match self {
1124
1130
CandidateRouteHop :: Blinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
1125
1131
CandidateRouteHop :: OneHopBlinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
@@ -1156,8 +1162,12 @@ impl<'a> CandidateRouteHop<'a> {
1156
1162
}
1157
1163
}
1158
1164
1165
+ /// A wrapper around the various hop id representations.
1166
+ ///
1167
+ /// `CandidateHopId::Clear` is used to identify a hop with a known short channel id and direction.
1168
+ /// `CandidateHopId::Blinded` is used to identify a blinded hop `hint_idx`.
1159
1169
#[ derive( Clone , Copy , Eq , Hash , Ord , PartialOrd , PartialEq ) ]
1160
- enum CandidateHopId {
1170
+ pub enum CandidateHopId {
1161
1171
/// Contains (scid, src_node_id < target_node_id)
1162
1172
Clear ( ( u64 , bool ) ) ,
1163
1173
/// Index of the blinded route hint in [`Payee::Blinded::route_hints`].
0 commit comments