Skip to content

Commit

Permalink
f - rename ChannelManager::request_invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
jkczyz committed Sep 19, 2023
1 parent d11fc6b commit 087941d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6880,18 +6880,26 @@ where
Ok(builder)
}

/// Creates an [`InvoiceRequest`] for an [`Offer`] from the given parameters and enqueues it to
/// be sent via an onion message.
/// Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
/// enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
/// [`Bolt12Invoice`] once it is received.
///
/// Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
/// the [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the request.
/// the [`ChannelManager`] when handling a [`Bolt12Invoice`] message for the request. The
/// optional parameters are used in the builder, if `Some`:
/// - `quantity` for [`InvoiceRequest::quantity`] which may be set if
/// [`Offer::expects_quantity`] is `true`.
/// - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
/// - `payer_note` for [`InvoiceRequest::payer_note`].
///
/// The provided `payment_id` is used to ensure that only one invoice is paid for the request.
///
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
/// [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
/// [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
/// [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
pub fn request_invoice(
pub fn pay_for_offer(
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
payer_note: Option<String>, payment_id: PaymentId, retry_strategy: Retry
) -> Result<(), Bolt12SemanticError> {
Expand Down

0 comments on commit 087941d

Please sign in to comment.