Enum lightning::ln::channelmanager::PaymentSendFailure
source · [−]pub enum PaymentSendFailure {
ParameterError(APIError),
PathParameterError(Vec<Result<(), APIError>>),
AllFailedRetrySafe(Vec<APIError>),
PartialFailure {
results: Vec<Result<(), APIError>>,
failed_paths_retry: Option<RouteParameters>,
payment_id: PaymentId,
},
}
Expand description
If a payment fails to send, it can be in one of several states. This enum is returned as the Err() type describing which state the payment is in, see the description of individual enum states for more.
Variants
ParameterError(APIError)
A parameter which was passed to send_payment was invalid, preventing us from attempting to send the payment at all. No channel state has been changed or messages sent to peers, and once you’ve changed the parameter at error, you can freely retry the payment in full.
PathParameterError(Vec<Result<(), APIError>>)
A parameter in a single path which was passed to send_payment was invalid, preventing us from attempting to send the payment at all. No channel state has been changed or messages sent to peers, and once you’ve changed the parameter at error, you can freely retry the payment in full.
The results here are ordered the same as the paths in the route object which was passed to send_payment.
AllFailedRetrySafe(Vec<APIError>)
All paths which were attempted failed to send, with no channel state change taking place. You can freely retry the payment in full (though you probably want to do so over different paths than the ones selected).
PartialFailure
Fields
failed_paths_retry: Option<RouteParameters>
If some paths failed without irrevocably committing to the new HTLC(s), this will
contain a RouteParameters
object which can be used to calculate a new route that
will pay all remaining unpaid balance.
payment_id: PaymentId
The payment id for the payment, which is now at least partially pending.
Some paths which were attempted failed to send, though possibly not all. At least some paths have irrevocably committed to the HTLC and retrying the payment in full would result in over-/re-payment.
The results here are ordered the same as the paths in the route object which was passed to send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely retried (though there is currently no API with which to do so).
Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried as they will result in over-/re-payment. These HTLCs all either successfully sent (in the case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel with the latest update_id.
Trait Implementations
sourceimpl Clone for PaymentSendFailure
impl Clone for PaymentSendFailure
sourcefn clone(&self) -> PaymentSendFailure
fn clone(&self) -> PaymentSendFailure
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for PaymentSendFailure
impl Send for PaymentSendFailure
impl Sync for PaymentSendFailure
impl Unpin for PaymentSendFailure
impl UnwindSafe for PaymentSendFailure
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more