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=6c8e19a3665ba1c6ed53d91fdd01fc8b52d6c5d9;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), }