Enum CandidateRouteHop
pub enum CandidateRouteHop<'a> {
FirstHop(FirstHopCandidate<'a>),
PublicHop(PublicHopCandidate<'a>),
PrivateHop(PrivateHopCandidate<'a>),
Blinded(BlindedPathCandidate<'a>),
OneHopBlinded(OneHopBlindedPathCandidate<'a>),
}
Expand description
A wrapper around the various hop representations.
Can be used to examine the properties of a hop, potentially to decide whether to include it in a route.
Variants§
FirstHop(FirstHopCandidate<'a>)
A hop from the payer, where the outbound liquidity is known.
PublicHop(PublicHopCandidate<'a>)
A hop found in the ReadOnlyNetworkGraph
.
PrivateHop(PrivateHopCandidate<'a>)
A private hop communicated by the payee, generally via a BOLT 11 invoice.
Because BOLT 11 route hints can take multiple hops to get to the destination, this may not terminate at the payee.
Blinded(BlindedPathCandidate<'a>)
A blinded path which starts with an introduction point and ultimately terminates with the payee.
Because we don’t know the payee’s identity, CandidateRouteHop::target
will return
None
in this state.
Because blinded paths are “all or nothing”, and we cannot use just one part of a blinded
path, the full path is treated as a single CandidateRouteHop
.
OneHopBlinded(OneHopBlindedPathCandidate<'a>)
Similar to Self::Blinded
, but the path here only has one hop.
While we treat this similarly to CandidateRouteHop::Blinded
in many respects (e.g.
returning None
from CandidateRouteHop::target
), in this case we do actually know the
payee’s identity - it’s the introduction point!
BlindedPayInfo
provided for 1-hop blinded paths is ignored because it is meant to apply
to the hops between the introduction node and the destination.
This primarily exists to track that we need to included a blinded path at the end of our
Route
, even though it doesn’t actually add an additional hop in the payment.
Implementations§
§impl<'a> CandidateRouteHop<'a>
impl<'a> CandidateRouteHop<'a>
pub fn globally_unique_short_channel_id(&self) -> Option<u64>
pub fn globally_unique_short_channel_id(&self) -> Option<u64>
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.
pub fn cltv_expiry_delta(&self) -> u32
pub fn cltv_expiry_delta(&self) -> u32
Returns the required difference in HTLC CLTV expiry between the Self::source
and the
next-hop for an HTLC taking this hop.
This is the time that the node(s) in this hop have to claim the HTLC on-chain if the next-hop goes on chain with a payment preimage.
pub fn htlc_minimum_msat(&self) -> u64
pub fn htlc_minimum_msat(&self) -> u64
Returns the minimum amount that can be sent over this hop, in millisatoshis.
pub fn fees(&self) -> RoutingFees
pub fn fees(&self) -> RoutingFees
Returns the fees that must be paid to route an HTLC over this channel.
pub fn source(&self) -> NodeId
pub fn source(&self) -> NodeId
Returns the source node id of current hop.
Source node id refers to the node forwarding the HTLC through this hop.
For Self::FirstHop
we return payer’s node id.
pub fn target(&self) -> Option<NodeId>
pub fn target(&self) -> Option<NodeId>
Returns the target node id of this hop, if known.
Target node id refers to the node receiving the HTLC after this hop.
For Self::Blinded
we return None
because the ultimate destination after the blinded
path is unknown.
For Self::OneHopBlinded
we return None
because the target is the same as the source,
and such a return value would be somewhat nonsensical.
Trait Implementations§
§impl<'a> Clone for CandidateRouteHop<'a>
impl<'a> Clone for CandidateRouteHop<'a>
§fn clone(&self) -> CandidateRouteHop<'a>
fn clone(&self) -> CandidateRouteHop<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for CandidateRouteHop<'a>
impl<'a> RefUnwindSafe for CandidateRouteHop<'a>
impl<'a> Send for CandidateRouteHop<'a>
impl<'a> Sync for CandidateRouteHop<'a>
impl<'a> Unpin for CandidateRouteHop<'a>
impl<'a> UnwindSafe for CandidateRouteHop<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request