@@ -1059,7 +1059,11 @@ pub enum CandidateRouteHop<'a> {
1059
1059
}
1060
1060
1061
1061
impl < ' a > CandidateRouteHop < ' a > {
1062
- fn short_channel_id ( & self ) -> Option < u64 > {
1062
+ /// Returns short_channel_id if known.
1063
+ /// For `FirstHop` we assume [`ChannelDetails::get_outbound_payment_scid`] is always set, this assumption is checked in
1064
+ /// [`find_route`] method.
1065
+ /// For `Blinded` and `OneHopBlinded` we return `None` because next hop is not known.
1066
+ pub fn short_channel_id ( & self ) -> Option < u64 > {
1063
1067
match self {
1064
1068
CandidateRouteHop :: FirstHop { details, .. } => Some ( details. get_outbound_payment_scid ( ) . unwrap ( ) ) ,
1065
1069
CandidateRouteHop :: PublicHop { short_channel_id, .. } => Some ( * short_channel_id) ,
@@ -1080,7 +1084,8 @@ impl<'a> CandidateRouteHop<'a> {
1080
1084
}
1081
1085
}
1082
1086
1083
- fn cltv_expiry_delta ( & self ) -> u32 {
1087
+ /// Returns cltv_expiry_delta for this hop.
1088
+ pub fn cltv_expiry_delta ( & self ) -> u32 {
1084
1089
match self {
1085
1090
CandidateRouteHop :: FirstHop { .. } => 0 ,
1086
1091
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . cltv_expiry_delta as u32 ,
@@ -1090,7 +1095,8 @@ impl<'a> CandidateRouteHop<'a> {
1090
1095
}
1091
1096
}
1092
1097
1093
- fn htlc_minimum_msat ( & self ) -> u64 {
1098
+ /// Returns the htlc_minimum_msat for this hop.
1099
+ pub fn htlc_minimum_msat ( & self ) -> u64 {
1094
1100
match self {
1095
1101
CandidateRouteHop :: FirstHop { details, .. } => details. next_outbound_htlc_minimum_msat ,
1096
1102
CandidateRouteHop :: PublicHop { info, .. } => info. direction ( ) . htlc_minimum_msat ,
@@ -1100,7 +1106,8 @@ impl<'a> CandidateRouteHop<'a> {
1100
1106
}
1101
1107
}
1102
1108
1103
- fn fees ( & self ) -> RoutingFees {
1109
+ /// Returns the fees for this hop.
1110
+ pub fn fees ( & self ) -> RoutingFees {
1104
1111
match self {
1105
1112
CandidateRouteHop :: FirstHop { .. } => RoutingFees {
1106
1113
base_msat : 0 , proportional_millionths : 0 ,
0 commit comments