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.
This commit is contained in:
Valentine Wallace 2024-10-30 11:39:52 -04:00
parent 2ff6524da4
commit 639446ad63
No known key found for this signature in database
GPG key ID: FD3E106A2CE099B4

View file

@ -945,7 +945,7 @@ impl OutboundPayments {
}; };
let payment_params = Some(route_params.payment_params.clone()); 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_hash, recipient_onion.clone(), keysend_preimage, &route, Some(retry_strategy),
payment_params, entropy_source, best_block_height payment_params, entropy_source, best_block_height
); );
@ -1546,7 +1546,7 @@ impl OutboundPayments {
match pending_outbounds.entry(payment_id) { match pending_outbounds.entry(payment_id) {
hash_map::Entry::Occupied(_) => Err(PaymentSendFailure::DuplicatePayment), hash_map::Entry::Occupied(_) => Err(PaymentSendFailure::DuplicatePayment),
hash_map::Entry::Vacant(entry) => { 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_hash, recipient_onion, keysend_preimage, route, retry_strategy,
payment_params, entropy_source, best_block_height payment_params, entropy_source, best_block_height
); );
@ -1557,7 +1557,7 @@ impl OutboundPayments {
} }
fn create_pending_payment<ES: Deref>( fn create_pending_payment<ES: Deref>(
&self, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
keysend_preimage: Option<PaymentPreimage>, route: &Route, retry_strategy: Option<Retry>, keysend_preimage: Option<PaymentPreimage>, route: &Route, retry_strategy: Option<Retry>,
payment_params: Option<PaymentParameters>, entropy_source: &ES, best_block_height: u32 payment_params: Option<PaymentParameters>, entropy_source: &ES, best_block_height: u32
) -> (PendingOutboundPayment, Vec<[u8; 32]>) ) -> (PendingOutboundPayment, Vec<[u8; 32]>)