Skip to content

Commit 5a0b111

Browse files
committed
Document InvoiceRequestFailed in ChannelManager
1 parent 2840252 commit 5a0b111

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
@@ -3608,9 +3608,10 @@ where
36083608
///
36093609
/// # Requested Invoices
36103610
///
3611-
/// In the case of paying a [`Bolt12Invoice`], abandoning the payment prior to receiving the
3612-
/// invoice will result in an [`Event::InvoiceRequestFailed`] and prevent any attempts at paying
3613-
/// it once received. The other events may only be generated once the invoice has been received.
3611+
/// In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
3612+
/// the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
3613+
/// and prevent any attempts at paying it once received. The other events may only be generated
3614+
/// once the invoice has been received.
36143615
///
36153616
/// # Restart Behavior
36163617
///
@@ -7348,6 +7349,8 @@ where
73487349
///
73497350
/// The provided `payment_id` is used to ensure that only one invoice is paid for the refund. To
73507351
/// revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the invoice.
7352+
/// If an invoice isn't received before expiration, the payment will fail with an
7353+
/// [`Event::InvoiceRequestFailed`].
73517354
///
73527355
/// Uses a one-hop [`BlindedPath`] for the refund with [`ChannelManager::get_our_node_id`] as
73537356
/// the introduction node and a derived payer id for sender privacy. As such, currently, the
@@ -7397,8 +7400,11 @@ where
73977400
///
73987401
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request
73997402
/// when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
7400-
/// been sent. To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving
7401-
/// the invoice.
7403+
/// been sent.
7404+
///
7405+
/// To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
7406+
/// invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
7407+
/// payment will fail with an [`Event::InvoiceRequestFailed`].
74027408
///
74037409
/// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link.
74047410
///

0 commit comments

Comments
 (0)