Enum PendingHTLCRouting
pub enum PendingHTLCRouting {
Forward {
onion_packet: OnionPacket,
short_channel_id: u64,
blinded: Option<BlindedForward>,
},
Receive {
payment_data: FinalOnionHopData,
payment_metadata: Option<Vec<u8>>,
payment_context: Option<PaymentContext>,
incoming_cltv_expiry: u32,
phantom_shared_secret: Option<[u8; 32]>,
custom_tlvs: Vec<(u64, Vec<u8>)>,
requires_blinded_error: bool,
},
ReceiveKeysend {
payment_data: Option<FinalOnionHopData>,
payment_preimage: PaymentPreimage,
payment_metadata: Option<Vec<u8>>,
incoming_cltv_expiry: u32,
custom_tlvs: Vec<(u64, Vec<u8>)>,
requires_blinded_error: bool,
},
}
Expand description
Information about where a received HTLC(’s onion) has indicated the HTLC should go.
Variants§
Forward
An HTLC which should be forwarded on to another node.
Fields
onion_packet: OnionPacket
The onion which should be included in the forwarded HTLC, telling the next hop what to do with the HTLC.
short_channel_id: u64
The short channel ID of the channel which we were instructed to forward this HTLC to.
This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
to the receiving node, such as one returned from
ChannelManager::get_intercept_scid
or ChannelManager::get_phantom_scid
.
blinded: Option<BlindedForward>
Set if this HTLC is being forwarded within a blinded path.
Receive
The onion indicates that this is a payment for an invoice (supposedly) generated by us.
Note that at this point, we have not checked that the invoice being paid was actually generated by us, but rather it’s claiming to pay an invoice of ours.
Fields
payment_data: FinalOnionHopData
Information about the amount the sender intended to pay and (potential) proof that this is a payment for an invoice we generated. This proof of payment is is also used for linking MPP parts of a larger payment.
payment_metadata: Option<Vec<u8>>
Additional data which we (allegedly) instructed the sender to include in the onion.
For HTLCs received by LDK, this will ultimately be exposed in
Event::PaymentClaimable::onion_fields
as
RecipientOnionFields::payment_metadata
.
payment_context: Option<PaymentContext>
The context of the payment included by the recipient in a blinded path, or None
if a
blinded path was not used.
Used in part to determine the events::PaymentPurpose
.
incoming_cltv_expiry: u32
CLTV expiry of the received HTLC.
Used to track when we should expire pending HTLCs that go unclaimed.
If the onion had forwarding instructions to one of our phantom node SCIDs, this will provide the onion shared secret used to decrypt the next level of forwarding instructions.
custom_tlvs: Vec<(u64, Vec<u8>)>
Custom TLVs which were set by the sender.
For HTLCs received by LDK, this will ultimately be exposed in
Event::PaymentClaimable::onion_fields
as
RecipientOnionFields::custom_tlvs
.
ReceiveKeysend
The onion indicates that this is for payment to us but which contains the preimage for claiming included, and is unrelated to any invoice we’d previously generated (aka a “keysend” or “spontaneous” payment).
Fields
payment_data: Option<FinalOnionHopData>
Information about the amount the sender intended to pay and possibly a token to associate MPP parts of a larger payment.
This will only be filled in if receiving MPP keysend payments is enabled, and it being present will cause deserialization to fail on versions of LDK prior to 0.0.116.
payment_preimage: PaymentPreimage
Preimage for this onion payment. This preimage is provided by the sender and will be used to settle the spontaneous payment.
payment_metadata: Option<Vec<u8>>
Additional data which we (allegedly) instructed the sender to include in the onion.
For HTLCs received by LDK, this will ultimately bubble back up as
RecipientOnionFields::payment_metadata
.
incoming_cltv_expiry: u32
CLTV expiry of the received HTLC.
Used to track when we should expire pending HTLCs that go unclaimed.
Trait Implementations§
§impl Clone for PendingHTLCRouting
impl Clone for PendingHTLCRouting
§fn clone(&self) -> PendingHTLCRouting
fn clone(&self) -> PendingHTLCRouting
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Readable for PendingHTLCRouting
impl Readable for PendingHTLCRouting
§fn read<R>(reader: &mut R) -> Result<PendingHTLCRouting, DecodeError>where
R: Read,
fn read<R>(reader: &mut R) -> Result<PendingHTLCRouting, DecodeError>where
R: Read,
Self
in from the given Read
.§impl Writeable for PendingHTLCRouting
impl Writeable for PendingHTLCRouting
Auto Trait Implementations§
impl Freeze for PendingHTLCRouting
impl RefUnwindSafe for PendingHTLCRouting
impl Send for PendingHTLCRouting
impl Sync for PendingHTLCRouting
impl Unpin for PendingHTLCRouting
impl UnwindSafe for PendingHTLCRouting
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