Skip to content

Commit 8c9814b

Browse files
committed
Document InvoiceRequestFailed in ChannelManager
1 parent 008564b commit 8c9814b

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

lightning/src/events/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,13 @@ pub enum Event {
514514
sender_intended_total_msat: Option<u64>,
515515
},
516516
/// Indicates a request for an invoice failed to yield a response in a reasonable amount of time
517-
/// or was explicitly abandoned by [`ChannelManager::abandon_payment`].
517+
/// or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
518+
/// [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
518519
///
519520
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
521+
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
522+
/// [`Offer`]: crate::offers::offer::Offer
523+
/// [`Refund`]: crate::offers::refund::Refund
520524
InvoiceRequestFailed {
521525
/// The `payment_id` to have been associated with payment for the requested invoice.
522526
payment_id: PaymentId,

lightning/src/ln/channelmanager.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,9 +3583,10 @@ where
35833583
///
35843584
/// # Requested Invoices
35853585
///
3586-
/// In the case of paying a [`Bolt12Invoice`], abandoning the payment prior to receiving the
3587-
/// invoice will result in an [`Event::InvoiceRequestFailed`] and prevent any attempts at paying
3588-
/// it once received. The other events may only be generated once the invoice has been received.
3586+
/// In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
3587+
/// the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
3588+
/// and prevent any attempts at paying it once received. The other events may only be generated
3589+
/// once the invoice has been received.
35893590
///
35903591
/// # Restart Behavior
35913592
///
@@ -7193,6 +7194,8 @@ where
71937194
///
71947195
/// The provided `payment_id` is used to ensure that only one invoice is paid for the refund. To
71957196
/// revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the invoice.
7197+
/// If an invoice isn't received before expiration, the payment will fail with an
7198+
/// [`Event::InvoiceRequestFailed`].
71967199
///
71977200
/// Uses a one-hop [`BlindedPath`] for the refund with [`ChannelManager::get_our_node_id`] as
71987201
/// the introduction node and a derived payer id for sender privacy. As such, currently, the
@@ -7242,8 +7245,11 @@ where
72427245
///
72437246
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request
72447247
/// when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
7245-
/// been sent. To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving
7246-
/// the invoice.
7248+
/// been sent.
7249+
///
7250+
/// To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
7251+
/// invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
7252+
/// payment will fail with an [`Event::InvoiceRequestFailed`].
72477253
///
72487254
/// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link.
72497255
///

0 commit comments

Comments
 (0)