+ /// Returns the globally unique short channel ID for this hop, if one is known.
+ ///
+ /// This only returns `Some` if the channel is public (either our own, or one we've learned
+ /// from the public network graph), and thus the short channel ID we have for this channel is
+ /// globally unique and identifies this channel in a global namespace.
+ #[inline]
+ pub fn globally_unique_short_channel_id(&self) -> Option<u64> {
+ match self {
+ CandidateRouteHop::FirstHop { details, .. } => if details.is_public { details.short_channel_id } else { None },
+ CandidateRouteHop::PublicHop { short_channel_id, .. } => Some(*short_channel_id),
+ CandidateRouteHop::PrivateHop { .. } => None,
+ CandidateRouteHop::Blinded { .. } => None,
+ CandidateRouteHop::OneHopBlinded { .. } => None,
+ }
+ }
+