Skip to content

Commit 313fc7b

Browse files
committed
f - rename ChannelManager::request_invoice
1 parent 5da2e9c commit 313fc7b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7137,18 +7137,26 @@ where
71377137
Ok(builder)
71387138
}
71397139

7140-
/// Creates an [`InvoiceRequest`] for an [`Offer`] from the given parameters and enqueues it to
7141-
/// be sent via an onion message.
7140+
/// Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
7141+
/// enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
7142+
/// [`Bolt12Invoice`] once it is received.
71427143
///
71437144
/// Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
7144-
/// the [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the request.
7145+
/// the [`ChannelManager`] when handling a [`Bolt12Invoice`] message for the request. The
7146+
/// optional parameters are used in the builder, if `Some`:
7147+
/// - `quantity` for [`InvoiceRequest::quantity`] which may be set if
7148+
/// [`Offer::expects_quantity`] is `true`.
7149+
/// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
7150+
/// - `payer_note` for [`InvoiceRequest::payer_note`].
71457151
///
71467152
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request.
71477153
///
71487154
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
7155+
/// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
7156+
/// [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
71497157
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
71507158
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
7151-
pub fn request_invoice(
7159+
pub fn pay_for_offer(
71527160
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
71537161
payer_note: Option<String>, payment_id: PaymentId, retry_strategy: Retry,
71547162
max_total_routing_fee_msat: Option<u64>

0 commit comments

Comments
 (0)