@@ -1099,6 +1099,7 @@ impl<'a> CandidateRouteHop<'a> {
1099
1099
///
1100
1100
/// Note that this is deliberately not public as it is somewhat of a footgun because it doesn't
1101
1101
/// define a global namespace.
1102
+ #[ inline]
1102
1103
fn short_channel_id ( & self ) -> Option < u64 > {
1103
1104
match self {
1104
1105
CandidateRouteHop :: FirstHop { details, .. } => details. get_outbound_payment_scid ( ) ,
@@ -1114,6 +1115,7 @@ impl<'a> CandidateRouteHop<'a> {
1114
1115
/// This only returns `Some` if the channel is public (either our own, or one we've learned
1115
1116
/// from the public network graph), and thus the short channel ID we have for this channel is
1116
1117
/// globally unique and identifies this channel in a global namespace.
1118
+ #[ inline]
1117
1119
pub fn globally_unique_short_channel_id ( & self ) -> Option < u64 > {
1118
1120
match self {
1119
1121
CandidateRouteHop :: FirstHop { details, .. } => if details. is_public { details. short_channel_id } else { None } ,
@@ -1136,6 +1138,7 @@ impl<'a> CandidateRouteHop<'a> {
1136
1138
}
1137
1139
1138
1140
/// Returns cltv_expiry_delta for this hop.
1141
+ #[ inline]
1139
1142
pub fn cltv_expiry_delta ( & self ) -> u32 {
1140
1143
match self {
1141
1144
CandidateRouteHop :: FirstHop { .. } => 0 ,
@@ -1147,6 +1150,7 @@ impl<'a> CandidateRouteHop<'a> {
1147
1150
}
1148
1151
1149
1152
/// Returns the htlc_minimum_msat for this hop.
1153
+ #[ inline]
1150
1154
pub fn htlc_minimum_msat ( & self ) -> u64 {
1151
1155
match self {
1152
1156
CandidateRouteHop :: FirstHop { details, .. } => details. next_outbound_htlc_minimum_msat ,
@@ -1158,6 +1162,7 @@ impl<'a> CandidateRouteHop<'a> {
1158
1162
}
1159
1163
1160
1164
/// Returns the fees for this hop.
1165
+ #[ inline]
1161
1166
pub fn fees ( & self ) -> RoutingFees {
1162
1167
match self {
1163
1168
CandidateRouteHop :: FirstHop { .. } => RoutingFees {
@@ -1195,6 +1200,7 @@ impl<'a> CandidateRouteHop<'a> {
1195
1200
/// Returns an ID describing the given hop.
1196
1201
///
1197
1202
/// See the docs on [`CandidateHopId`] for when this is, or is not, unique.
1203
+ #[ inline]
1198
1204
fn id ( & self ) -> CandidateHopId {
1199
1205
match self {
1200
1206
CandidateRouteHop :: Blinded { hint_idx, .. } => CandidateHopId :: Blinded ( * hint_idx) ,
@@ -1215,6 +1221,7 @@ impl<'a> CandidateRouteHop<'a> {
1215
1221
/// Source node id refers to the hop forwarding the payment.
1216
1222
///
1217
1223
/// For `FirstHop` we return payer's node id.
1224
+ #[ inline]
1218
1225
pub fn source ( & self ) -> NodeId {
1219
1226
match self {
1220
1227
CandidateRouteHop :: FirstHop { node_id, .. } => * node_id,
@@ -1229,7 +1236,8 @@ impl<'a> CandidateRouteHop<'a> {
1229
1236
/// Target node id refers to the hop receiving the payment.
1230
1237
///
1231
1238
/// For `Blinded` and `OneHopBlinded` we return `None` because next hop is blinded.
1232
- pub fn target ( & self ) -> Option < NodeId > {
1239
+ #[ inline]
1240
+ pub fn target ( & self ) -> Option < NodeId > {
1233
1241
match self {
1234
1242
CandidateRouteHop :: FirstHop { details, .. } => Some ( details. counterparty . node_id . into ( ) ) ,
1235
1243
CandidateRouteHop :: PublicHop { info, .. } => Some ( * info. target ( ) ) ,
0 commit comments