pub enum ForwardingError {
Show 15 variants
ZeroAmountHtlc,
ChannelNotFound(ShortChannelID),
NodeNotFound(PublicKey),
PaymentHashExists(PaymentHash),
PaymentHashNotFound(PaymentHash),
InsufficientBalance(u64, u64),
LessThanMinimum(u64, u64),
MoreThanMaximum(u64, u64),
ExceedsInFlightCount(u64, u64),
ExceedsInFlightTotal(u64, u64),
ExpiryInSeconds(u32, u32),
InsufficientCltvDelta(u32, u32),
InsufficientFee(u64, u64, u64, u64),
FeeOverflow(u64, u64, u64),
SanityCheckFailed(u64, u64),
}
Expand description
ForwardingError represents the various errors that we can run into when forwarding payments in a simulated network. Since we’re not using real lightning nodes, these errors are not obfuscated and can be propagated to the sending node and used for analysis.
Variants§
ZeroAmountHtlc
Zero amount htlcs are invalid in the protocol.
ChannelNotFound(ShortChannelID)
The outgoing channel id was not found in the network graph.
NodeNotFound(PublicKey)
The node pubkey provided was not associated with the channel in the network graph.
PaymentHashExists(PaymentHash)
The channel has already forwarded an HTLC with the payment hash provided. TODO: remove if MPP support is added.
PaymentHashNotFound(PaymentHash)
An htlc with the payment hash provided could not be found to resolve.
InsufficientBalance(u64, u64)
The forwarding node did not have sufficient outgoing balance to forward the htlc (htlc amount / balance).
LessThanMinimum(u64, u64)
The htlc forwarded is less than the channel’s advertised minimum htlc amount (htlc amount / minimum).
MoreThanMaximum(u64, u64)
The htlc forwarded is more than the channel’s advertised maximum htlc amount (htlc amount / maximum).
ExceedsInFlightCount(u64, u64)
The channel has reached its maximum allowable number of htlcs in flight (total in flight / maximim).
ExceedsInFlightTotal(u64, u64)
The forwarded htlc’s amount would push the channel over its maximum allowable in flight total (total in flight / maximum).
ExpiryInSeconds(u32, u32)
The forwarded htlc’s cltv expiry exceeds the maximum value used to express block heights in Bitcoin.
InsufficientCltvDelta(u32, u32)
The forwarded htlc has insufficient cltv delta for the channel’s minimum delta (cltv delta / minimum).
InsufficientFee(u64, u64, u64, u64)
The forwarded htlc has insufficient fee for the channel’s policy (fee / expected fee / base fee / prop fee).
FeeOverflow(u64, u64, u64)
The fee policy for a htlc amount would overflow with the given fee policy (htlc amount / base fee / prop fee).
SanityCheckFailed(u64, u64)
Sanity check on channel balances failed (node balances / channel capacity).
Trait Implementations§
Source§impl Debug for ForwardingError
impl Debug for ForwardingError
Source§impl Display for ForwardingError
impl Display for ForwardingError
Source§impl Error for ForwardingError
impl Error for ForwardingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for ForwardingError
impl RefUnwindSafe for ForwardingError
impl Send for ForwardingError
impl Sync for ForwardingError
impl Unpin for ForwardingError
impl UnwindSafe for ForwardingError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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