Skip to content

Commit 3fd9fc6

Browse files
committed
Organize create_refund and pay_for_offer docs
1 parent 5a0b111 commit 3fd9fc6

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7318,6 +7318,8 @@ where
73187318
/// [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will
73197319
/// not have an expiration unless otherwise set on the builder.
73207320
///
7321+
/// # Privacy
7322+
///
73217323
/// Uses a one-hop [`BlindedPath`] for the offer with [`ChannelManager::get_our_node_id`] as the
73227324
/// introduction node and a derived signing pubkey for recipient privacy. As such, currently,
73237325
/// the node must be announced. Otherwise, there is no way to find a path to the introduction
@@ -7342,21 +7344,32 @@ where
73427344
/// Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
73437345
/// [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
73447346
///
7347+
/// # Payment
7348+
///
7349+
/// The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
7350+
/// See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
7351+
///
73457352
/// The builder will have the provided expiration set. Any changes to the expiration on the
73467353
/// returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
73477354
/// block time minus two hours is used for the current time when determining if the refund has
73487355
/// expired.
73497356
///
7350-
/// The provided `payment_id` is used to ensure that only one invoice is paid for the refund. To
7351-
/// 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`].
7357+
/// To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
7358+
/// invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
7359+
/// with an [`Event::InvoiceRequestFailed`].
7360+
///
7361+
/// # Privacy
73547362
///
73557363
/// Uses a one-hop [`BlindedPath`] for the refund with [`ChannelManager::get_our_node_id`] as
73567364
/// the introduction node and a derived payer id for sender privacy. As such, currently, the
73577365
/// node must be announced. Otherwise, there is no way to find a path to the introduction node
73587366
/// in order to send the [`Bolt12Invoice`].
73597367
///
7368+
/// # Errors
7369+
///
7370+
/// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link
7371+
/// or if `amount_msats` is invalid.
7372+
///
73607373
/// [`Refund`]: crate::offers::refund::Refund
73617374
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
73627375
pub fn create_refund_builder(
@@ -7398,6 +7411,8 @@ where
73987411
/// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
73997412
/// - `payer_note` for [`InvoiceRequest::payer_note`].
74007413
///
7414+
/// # Payment
7415+
///
74017416
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request
74027417
/// when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
74037418
/// been sent.
@@ -7406,7 +7421,10 @@ where
74067421
/// invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
74077422
/// payment will fail with an [`Event::InvoiceRequestFailed`].
74087423
///
7409-
/// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link.
7424+
/// # Errors
7425+
///
7426+
/// Errors if a duplicate `payment_id` is provided given the caveats in the aforementioned link
7427+
/// or if the provided parameters are invalid for the offer.
74107428
///
74117429
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
74127430
/// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity

0 commit comments

Comments
 (0)