From: Matt Corallo Date: Sat, 17 Aug 2024 23:53:16 +0000 (+0000) Subject: Avoid options holding references in the public API X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=a7a2860cd9373e228915c2b65381cfb308df929f;p=rust-lightning Avoid options holding references in the public API --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 2a16a3018..eccffa5d3 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -4234,10 +4234,10 @@ where /// whether or not the payment was successful. /// /// [timer tick]: Self::timer_tick_occurred - pub fn send_payment_for_bolt12_invoice( - &self, invoice: &Bolt12Invoice, context: Option<&OffersContext>, + pub(crate) fn send_payment_for_bolt12_invoice( + &self, invoice: &Bolt12Invoice, context: Option, ) -> Result<(), Bolt12PaymentError> { - match self.verify_bolt12_invoice(invoice, context) { + match self.verify_bolt12_invoice(invoice, context.as_ref()) { Ok(payment_id) => self.send_payment_for_verified_bolt12_invoice(invoice, payment_id), Err(()) => Err(Bolt12PaymentError::UnexpectedInvoice), }