]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Avoid options holding references in the public API
authorMatt Corallo <git@bluematt.me>
Sat, 17 Aug 2024 23:53:16 +0000 (23:53 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 14:00:24 +0000 (14:00 +0000)
lightning/src/ln/channelmanager.rs

index 2a16a30182f0833d11bdc6ba49c7f0c95e41502a..eccffa5d39b2c59824d0449859601d1f0ef07ab5 100644 (file)
@@ -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<OffersContext>,
        ) -> 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),
                }