From 8116d6e5ebc6f16f7e975e373f91072337a9598d Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 18 Sep 2023 13:52:18 -0500 Subject: [PATCH] f - rename ChannelManager::request_invoice --- lightning/src/ln/channelmanager.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 598f3ff81ea..a37eff8db37 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -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, amount_msats: Option, payer_note: Option, payment_id: PaymentId, retry_strategy: Retry ) -> Result<(), Bolt12SemanticError> {