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