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