Struct lightning::ln::channelmanager::PendingHTLCInfo

source ·
pub struct PendingHTLCInfo {
    pub routing: PendingHTLCRouting,
    pub incoming_shared_secret: [u8; 32],
    pub payment_hash: PaymentHash,
    pub incoming_amt_msat: Option<u64>,
    pub outgoing_amt_msat: u64,
    pub outgoing_cltv_value: u32,
    pub skimmed_fee_msat: Option<u64>,
}
Expand description

Information about an incoming HTLC, including the PendingHTLCRouting describing where it should go next.

Fields§

§routing: PendingHTLCRouting

Further routing details based on whether the HTLC is being forwarded or received.

§incoming_shared_secret: [u8; 32]

The onion shared secret we build with the sender used to decrypt the onion.

This is later used to encrypt failure packets in the event that the HTLC is failed.

§payment_hash: PaymentHash

Hash of the payment preimage, to lock the payment until the receiver releases the preimage.

§incoming_amt_msat: Option<u64>

Amount received in the incoming HTLC.

This field was added in LDK 0.0.113 and will be None for objects written by prior versions.

§outgoing_amt_msat: u64

The amount the sender indicated should be forwarded on to the next hop or amount the sender intended for us to receive for received payments.

If the received amount is less than this for received payments, an intermediary hop has attempted to steal some of our funds and we should fail the HTLC (the sender should retry it along another path).

Because nodes can take less than their required fees, and because senders may wish to improve their own privacy, this amount may be less than Self::incoming_amt_msat for received payments. In such cases, recipients must handle this HTLC as if it had received Self::outgoing_amt_msat.

§outgoing_cltv_value: u32

The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated should have been set on the received HTLC for received payments).

§skimmed_fee_msat: Option<u64>

The fee taken for this HTLC in addition to the standard protocol HTLC fees.

If this is a payment for forwarding, this is the fee we are taking before forwarding the HTLC.

If this is a received payment, this is the fee that our counterparty took.

This is used to allow LSPs to take fees as a part of payments, without the sender having to shoulder them.

Trait Implementations§

source§

impl Clone for PendingHTLCInfo

source§

fn clone(&self) -> PendingHTLCInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Readable for PendingHTLCInfo

source§

fn read<R: Read>(reader: &mut R) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
source§

impl Writeable for PendingHTLCInfo

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
source§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.
source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> MaybeReadable for T
where T: Readable,

source§

fn read<R>(reader: &mut R) -> Result<Option<T>, DecodeError>
where R: Read,

Reads a Self in from the given Read.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.