///
/// Note that this is deliberately not public as it is somewhat of a footgun because it doesn't
/// define a global namespace.
+ #[inline]
fn short_channel_id(&self) -> Option<u64> {
match self {
CandidateRouteHop::FirstHop { details, .. } => details.get_outbound_payment_scid(),
/// 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 },
}
/// Returns cltv_expiry_delta for this hop.
+ #[inline]
pub fn cltv_expiry_delta(&self) -> u32 {
match self {
CandidateRouteHop::FirstHop { .. } => 0,
}
/// Returns the htlc_minimum_msat for this hop.
+ #[inline]
pub fn htlc_minimum_msat(&self) -> u64 {
match self {
CandidateRouteHop::FirstHop { details, .. } => details.next_outbound_htlc_minimum_msat,
}
/// Returns the fees for this hop.
+ #[inline]
pub fn fees(&self) -> RoutingFees {
match self {
CandidateRouteHop::FirstHop { .. } => RoutingFees {
/// Returns an ID describing the given hop.
///
/// See the docs on [`CandidateHopId`] for when this is, or is not, unique.
+ #[inline]
fn id(&self) -> CandidateHopId {
match self {
CandidateRouteHop::Blinded { hint_idx, .. } => CandidateHopId::Blinded(*hint_idx),
/// Source node id refers to the hop forwarding the payment.
///
/// For `FirstHop` we return payer's node id.
+ #[inline]
pub fn source(&self) -> NodeId {
match self {
CandidateRouteHop::FirstHop { node_id, .. } => *node_id,
/// Target node id refers to the hop receiving the payment.
///
/// For `Blinded` and `OneHopBlinded` we return `None` because next hop is blinded.
- pub fn target(&self) -> Option<NodeId> {
+ #[inline]
+ pub fn target(&self) -> Option<NodeId> {
match self {
CandidateRouteHop::FirstHop { details, .. } => Some(details.counterparty.node_id.into()),
CandidateRouteHop::PublicHop { info, .. } => Some(*info.target()),