From 639446ad63bed1d70016a2fe116dce17a718213f Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Wed, 30 Oct 2024 11:39:52 -0400 Subject: [PATCH] Stop taking &self in outbound_payments' create_inbound_payment The method doesn't actually use its &self parameter, and this makes it more obvious that we aren't going to deadlock by calling the method if the outbound_payments lock is already acquired. --- lightning/src/ln/outbound_payment.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index 9c8998b89..04736f2a8 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -945,7 +945,7 @@ impl OutboundPayments { }; let payment_params = Some(route_params.payment_params.clone()); - let (retryable_payment, onion_session_privs) = self.create_pending_payment( + let (retryable_payment, onion_session_privs) = Self::create_pending_payment( payment_hash, recipient_onion.clone(), keysend_preimage, &route, Some(retry_strategy), payment_params, entropy_source, best_block_height ); @@ -1546,7 +1546,7 @@ impl OutboundPayments { match pending_outbounds.entry(payment_id) { hash_map::Entry::Occupied(_) => Err(PaymentSendFailure::DuplicatePayment), hash_map::Entry::Vacant(entry) => { - let (payment, onion_session_privs) = self.create_pending_payment( + let (payment, onion_session_privs) = Self::create_pending_payment( payment_hash, recipient_onion, keysend_preimage, route, retry_strategy, payment_params, entropy_source, best_block_height ); @@ -1557,7 +1557,7 @@ impl OutboundPayments { } fn create_pending_payment( - &self, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, + payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, keysend_preimage: Option, route: &Route, retry_strategy: Option, payment_params: Option, entropy_source: &ES, best_block_height: u32 ) -> (PendingOutboundPayment, Vec<[u8; 32]>) -- 2.39.5