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