Skip to content

Commit 0a4f230

Browse files
committed
f - rename ChannelManager::request_invoice
1 parent 4802f1d commit 0a4f230

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
@@ -7139,18 +7139,26 @@ where
71397139
Ok(builder)
71407140
}
71417141

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

0 commit comments

Comments
 (0)