Enum LocalHTLCFailureReason

Source
pub enum LocalHTLCFailureReason {
Show 43 variants TemporaryNodeFailure, PermanentNodeFailure, RequiredNodeFeature, InvalidOnionVersion, InvalidOnionHMAC, InvalidOnionKey, TemporaryChannelFailure, PermanentChannelFailure, RequiredChannelFeature, UnknownNextPeer, AmountBelowMinimum, FeeInsufficient, IncorrectCLTVExpiry, CLTVExpiryTooSoon, IncorrectPaymentDetails, FinalIncorrectCLTVExpiry, FinalIncorrectHTLCAmount, ChannelDisabled, CLTVExpiryTooFar, InvalidOnionPayload, MPPTimeout, InvalidOnionBlinding, UnknownFailureCode { code: u16, }, ForwardExpiryBuffer, InvalidTrampolineForward, PaymentClaimBuffer, DustLimitHolder, DustLimitCounterparty, FeeSpikeBuffer, PrivateChannelForward, RealSCIDForward, ChannelNotReady, InvalidKeysendPreimage, InvalidTrampolinePayload, PaymentSecretRequired, OutgoingCLTVTooSoon, ChannelClosed, OnChainTimeout, ZeroAmount, HTLCMinimum, HTLCMaximum, PeerOffline, ChannelBalanceOverdrawn,
}
Expand description

The reason that a HTLC was failed by the local node. These errors either represent direct, human-readable mappings of BOLT04 error codes or provide additional information that would otherwise be erased by the BOLT04 error code.

For example: Self::FeeInsufficient is a direct representation of its underlying BOLT04 error code. Self::PrivateChannelForward provides additional information that is not provided by its BOLT04 error code.

Variants§

§

TemporaryNodeFailure

There has been a temporary processing failure on the node which may resolve on retry.

§

PermanentNodeFailure

These has been a permanent processing failure on the node which will not resolve on retry.

§

RequiredNodeFeature

The HTLC does not implement a feature that is required by our node.

The sender may have outdated gossip, or a bug in its implementation.

§

InvalidOnionVersion

The onion version specified by the HTLC packet is unknown to our node.

§

InvalidOnionHMAC

The integrity of the HTLC packet cannot be verified because it has an invalid HMAC.

§

InvalidOnionKey

The onion packet has an invalid ephemeral key, so the HTLC cannot be processed.

§

TemporaryChannelFailure

A temporary forwarding error has occurred which may resolve on retry.

§

PermanentChannelFailure

A permanent forwarding error has occurred which will not resolve on retry.

§

RequiredChannelFeature

The HTLC does not implement a feature that is required by our channel for processing.

§

UnknownNextPeer

The HTLC’s target outgoing channel that is not known to our node.

§

AmountBelowMinimum

The HTLC amount is below our advertised htlc_minimum_msat.

The sender may have outdated gossip, or a bug in its implementation.

§

FeeInsufficient

The HTLC does not pay sufficient fees.

The sender may have outdated gossip, or a bug in its implementation.

§

IncorrectCLTVExpiry

The HTLC does not meet the cltv_expiry_delta advertised by our node, set by ChannelConfig::cltv_expiry_delta.

The sender may have outdated gossip, or a bug in its implementation.

§

CLTVExpiryTooSoon

The HTLC expires too close to the current block height to be safely processed.

§

IncorrectPaymentDetails

A payment was made to our node that either had incorrect payment information, or was unknown to us.

§

FinalIncorrectCLTVExpiry

The HTLC’s expiry is less than the expiry height specified by the sender.

The forwarding node has either tampered with this value, or the sending node has an old best block height.

§

FinalIncorrectHTLCAmount

The HTLC’s amount is less than the amount specified by the sender.

The forwarding node has tampered with this value, or has a bug in its implementation.

§

ChannelDisabled

The channel has been marked as disabled because the channel peer is offline.

§

CLTVExpiryTooFar

The HTLC expires too far in the future, so it is rejected to avoid the worst-case outcome of funds being held for extended periods of time.

§

InvalidOnionPayload

The HTLC payload contained in the onion packet could not be understood by our node.

§

MPPTimeout

The total amount for a multi-part payment did not arrive in time, so the HTLCs partially paying the amount were canceled.

§

InvalidOnionBlinding

Our node was selected as part of a blinded path, but the packet we received was not properly constructed, or had incorrect values for the blinded path.

This may happen if the forwarding node tamperd with the HTLC or the sender or recipient implementations have a bug.

§

UnknownFailureCode

UnknownFailureCode represents BOLT04 failure codes that we are not familiar with. We will encounter this if:

  • A peer sends us a new failure code that LDK has not yet been upgraded to understand.
  • We read a deprecated failure code from disk that LDK no longer uses.

See https://github.com/lightning/bolts/blob/master/04-onion-routing.md#returning-errors for latest defined error codes.

Fields

§code: u16

The bolt 04 failure code.

§

ForwardExpiryBuffer

A HTLC forward was failed back rather than forwarded on the proposed outgoing channel because its expiry is too close to the current block height to leave time to safely claim it on chain if the channel force closes.

§

InvalidTrampolineForward

The HTLC was failed because it has invalid trampoline forwarding information.

§

PaymentClaimBuffer

A HTLC receive was failed back rather than claimed because its expiry is too close to the current block height to leave time to safely claim it on chain if the channel force closes.

§

DustLimitHolder

The HTLC was failed because accepting it would push our commitment’s total amount of dust HTLCs over the limit that we allow to be burned to miner fees if the channel closed while they are unresolved.

§

DustLimitCounterparty

The HTLC was failed because accepting it would push our counterparty’s total amount of dust (small) HTLCs over the limit that we allow to be burned to miner fees if the channel closes while they are unresolved.

§

FeeSpikeBuffer

The HTLC was failed because it would drop the remote party’s channel balance such that it cannot cover the fees it is required to pay at various fee rates. This buffer is maintained so that channels can always maintain reasonable fee rates.

§

PrivateChannelForward

The HTLC that requested to be forwarded over a private channel was rejected to prevent revealing the existence of the channel.

§

RealSCIDForward

The HTLC was failed because it made a request to forward over the real channel ID of a channel that implements option_scid_alias which is a privacy feature to prevent the real channel ID from being known.

§

ChannelNotReady

The HTLC was rejected because our channel has not yet reached sufficient depth to be used.

§

InvalidKeysendPreimage

A keysend payment with a preimage that did not match the HTLC has was rejected.

§

InvalidTrampolinePayload

The HTLC was failed because it had an invalid trampoline payload.

§

PaymentSecretRequired

A payment was rejected because it did not include the correct payment secret from an invoice.

§

OutgoingCLTVTooSoon

The HTLC was failed because its expiry is too close to the current block height, and we expect that it will immediately be failed back by our downstream peer.

§

ChannelClosed

The HTLC was failed because it was pending on a channel which is now in the process of being closed.

§

OnChainTimeout

The HTLC was failed back because its expiry height was reached and funds were timed out on chain.

§

ZeroAmount

The HTLC was failed because zero amount HTLCs are not allowed.

§

HTLCMinimum

The HTLC was failed because its amount is less than the smallest HTLC that the channel can currently accept.

This may occur because the HTLC is smaller than the counterparty’s advertised minimum accepted HTLC size, or if we have reached our maximum total dust HTLC exposure.

§

HTLCMaximum

The HTLC was failed because its amount is more than then largest HTLC that the channel can currently accept.

This may occur because the outbound channel has insufficient liquidity to forward the HTLC, we have reached the counterparty’s in-flight limits, or the HTLC exceeds our advertised maximum accepted HTLC size.

§

PeerOffline

The HTLC was failed because our remote peer is offline.

§

ChannelBalanceOverdrawn

The HTLC was failed because the channel balance was overdrawn.

Trait Implementations§

Source§

impl Clone for LocalHTLCFailureReason

Source§

fn clone(&self) -> LocalHTLCFailureReason

Returns a duplicate 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 Debug for LocalHTLCFailureReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<LocalHTLCFailureReason> for HTLCHandlingFailureReason

Source§

fn from(value: LocalHTLCFailureReason) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for LocalHTLCFailureReason

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for LocalHTLCFailureReason

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Into<LocalHTLCFailureReason> for FailureCode

Source§

fn into(self) -> LocalHTLCFailureReason

Converts this type into the (usually inferred) input type.
Source§

impl PartialEq for LocalHTLCFailureReason

Source§

fn eq(&self, other: &LocalHTLCFailureReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Readable for LocalHTLCFailureReason

Source§

fn read<R: Read>(r: &mut R) -> Result<LocalHTLCFailureReason, DecodeError>

Reads a Self in from the given Read.
Source§

impl Writeable for LocalHTLCFailureReason

Source§

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

Writes self out to the given Writer.
Source§

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

Writes self out to a Vec<u8>.
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§

impl Copy for LocalHTLCFailureReason

Source§

impl Eq for LocalHTLCFailureReason

Source§

impl StructuralPartialEq for LocalHTLCFailureReason

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> LengthReadable for T
where T: Readable,

Source§

fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>

Reads a Self in from the given LengthLimitedRead.
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,

Source§

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>,

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V