Skip to content

Commit 5d5d9b1

Browse files
committed
f - rename ChannelManager::request_invoice
1 parent 7a68842 commit 5d5d9b1

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
@@ -6884,18 +6884,26 @@ where
68846884
Ok(builder)
68856885
}
68866886

6887-
/// Creates an [`InvoiceRequest`] for an [`Offer`] from the given parameters and enqueues it to
6888-
/// be sent via an onion message.
6887+
/// Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
6888+
/// enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
6889+
/// [`Bolt12Invoice`] once it is received.
68896890
///
68906891
/// Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
6891-
/// the [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the request.
6892+
/// the [`ChannelManager`] when handling a [`Bolt12Invoice`] message for the request. The
6893+
/// optional parameters are used in the builder, if `Some`:
6894+
/// - `quantity` for [`InvoiceRequest::quantity`] which may be set if
6895+
/// [`Offer::expects_quantity`] is `true`.
6896+
/// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
6897+
/// - `payer_note` for [`InvoiceRequest::payer_note`].
68926898
///
68936899
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request.
68946900
///
68956901
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6902+
/// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
6903+
/// [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
68966904
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
68976905
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6898-
pub fn request_invoice(
6906+
pub fn pay_for_offer(
68996907
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
69006908
payer_note: Option<String>, payment_id: PaymentId, retry_strategy: Retry
69016909
) -> Result<(), Bolt12SemanticError> {

0 commit comments

Comments
 (0)