@@ -1058,7 +1058,8 @@ impl<'a> CandidateRouteHop<'a> {
1058
1058
}
1059
1059
}
1060
1060
1061
- fn cltv_expiry_delta ( & self ) -> u32 {
1061
+ /// Returns cltv_expiry_delta for this hop.
1062
+ pub fn cltv_expiry_delta ( & self ) -> u32 {
1062
1063
match self {
1063
1064
CandidateRouteHop :: FirstHop { .. } => 0 ,
1064
1065
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . cltv_expiry_delta as u32 ,
@@ -1068,7 +1069,8 @@ impl<'a> CandidateRouteHop<'a> {
1068
1069
}
1069
1070
}
1070
1071
1071
- fn htlc_minimum_msat ( & self ) -> u64 {
1072
+ /// Returns the htlc_minimum_msat for this hop.
1073
+ pub fn htlc_minimum_msat ( & self ) -> u64 {
1072
1074
match self {
1073
1075
CandidateRouteHop :: FirstHop { details, .. } => details. next_outbound_htlc_minimum_msat ,
1074
1076
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . htlc_minimum_msat ,
@@ -1078,7 +1080,8 @@ impl<'a> CandidateRouteHop<'a> {
1078
1080
}
1079
1081
}
1080
1082
1081
- fn fees ( & self ) -> RoutingFees {
1083
+ /// Returns the fees for this hop.
1084
+ pub fn fees ( & self ) -> RoutingFees {
1082
1085
match self {
1083
1086
CandidateRouteHop :: FirstHop { .. } => RoutingFees {
1084
1087
base_msat : 0 , proportional_millionths : 0 ,
@@ -1112,7 +1115,10 @@ impl<'a> CandidateRouteHop<'a> {
1112
1115
}
1113
1116
}
1114
1117
1115
- fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1118
+ /// Returns the id of this hop.
1119
+ /// For `Blinded` and `OneHopBlinded` we return `CandidateHopId::Blinded` because we don't know the channel id.
1120
+ /// For any other option we return `CandidateHopId::Clear` because we know the channel id and the direction.
1121
+ pub fn id ( & self , channel_direction : bool /* src_node_id < target_node_id */ ) -> CandidateHopId {
1116
1122
match self {
1117
1123
CandidateRouteHop :: Blinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
1118
1124
CandidateRouteHop :: OneHopBlinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
@@ -1149,8 +1155,12 @@ impl<'a> CandidateRouteHop<'a> {
1149
1155
}
1150
1156
}
1151
1157
1158
+ /// A wrapper around the various hop id representations.
1159
+ ///
1160
+ /// `CandidateHopId::Clear` is used to identify a hop with a known short channel id and direction.
1161
+ /// `CandidateHopId::Blinded` is used to identify a blinded hop `hint_idx`.
1152
1162
#[ derive( Clone , Copy , Eq , Hash , Ord , PartialOrd , PartialEq ) ]
1153
- enum CandidateHopId {
1163
+ pub enum CandidateHopId {
1154
1164
/// Contains (scid, src_node_id < target_node_id)
1155
1165
Clear ( ( u64 , bool ) ) ,
1156
1166
/// Index of the blinded route hint in [`Payee::Blinded::route_hints`].
0 commit comments