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.
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
impl Clone for LocalHTLCFailureReason
Source§fn clone(&self) -> LocalHTLCFailureReason
fn clone(&self) -> LocalHTLCFailureReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LocalHTLCFailureReason
impl Debug for LocalHTLCFailureReason
Source§impl From<LocalHTLCFailureReason> for HTLCHandlingFailureReason
impl From<LocalHTLCFailureReason> for HTLCHandlingFailureReason
Source§fn from(value: LocalHTLCFailureReason) -> Self
fn from(value: LocalHTLCFailureReason) -> Self
Source§impl From<u16> for LocalHTLCFailureReason
impl From<u16> for LocalHTLCFailureReason
Source§impl Hash for LocalHTLCFailureReason
impl Hash for LocalHTLCFailureReason
Source§impl Into<LocalHTLCFailureReason> for FailureCode
impl Into<LocalHTLCFailureReason> for FailureCode
Source§fn into(self) -> LocalHTLCFailureReason
fn into(self) -> LocalHTLCFailureReason
Source§impl PartialEq for LocalHTLCFailureReason
impl PartialEq for LocalHTLCFailureReason
Source§impl Readable for LocalHTLCFailureReason
impl Readable for LocalHTLCFailureReason
Source§fn read<R: Read>(r: &mut R) -> Result<LocalHTLCFailureReason, DecodeError>
fn read<R: Read>(r: &mut R) -> Result<LocalHTLCFailureReason, DecodeError>
Self in from the given Read.Source§impl Writeable for LocalHTLCFailureReason
impl Writeable for LocalHTLCFailureReason
impl Copy for LocalHTLCFailureReason
impl Eq for LocalHTLCFailureReason
impl StructuralPartialEq for LocalHTLCFailureReason
Auto Trait Implementations§
impl Freeze for LocalHTLCFailureReason
impl RefUnwindSafe for LocalHTLCFailureReason
impl Send for LocalHTLCFailureReason
impl Sync for LocalHTLCFailureReason
impl Unpin for LocalHTLCFailureReason
impl UnwindSafe for LocalHTLCFailureReason
Blanket Implementations§
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.