Skip to content

Commit 2579d08

Browse files
committed
Introduce Bolt11PaymentError
In the upcoming commits, functions will require variant to handle cases where a Bolt11 invoice specifies an invalid amount. This commit introduces the variant, setting the stage for its usage in subsequent commits.
1 parent 5bc9ffa commit 2579d08

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,21 @@ pub(crate) enum PaymentSendFailure {
570570
},
571571
}
572572

573+
/// An error when attempting to pay a [`Bolt11Invoice`].
574+
///
575+
/// [`Bolt11Invoice`]: lightning_invoice::Bolt11Invoice
576+
#[derive(Debug)]
577+
pub enum Bolt11PaymentError {
578+
/// Incorrect amount was provided to ChannelManager::pay_for_bolt11_invoice.
579+
/// This happens when an amount is specified when [`Bolt11Invoice`] already contains
580+
/// an amount, or vice versa.
581+
///
582+
/// [`Bolt11Invoice`]: lightning_invoice::Bolt11Invoice
583+
InvalidAmount,
584+
/// The invoice was valid for the corresponding [`PaymentId`], but sending the payment failed.
585+
SendingFailed(RetryableSendFailure),
586+
}
587+
573588
/// An error when attempting to pay a [`Bolt12Invoice`].
574589
#[derive(Clone, Debug, PartialEq, Eq)]
575590
pub enum Bolt12PaymentError {

0 commit comments

Comments
 (0)