Skip to content

Commit 639446a

Browse files
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.
1 parent 2ff6524 commit 639446a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ impl OutboundPayments {
945945
};
946946

947947
let payment_params = Some(route_params.payment_params.clone());
948-
let (retryable_payment, onion_session_privs) = self.create_pending_payment(
948+
let (retryable_payment, onion_session_privs) = Self::create_pending_payment(
949949
payment_hash, recipient_onion.clone(), keysend_preimage, &route, Some(retry_strategy),
950950
payment_params, entropy_source, best_block_height
951951
);
@@ -1546,7 +1546,7 @@ impl OutboundPayments {
15461546
match pending_outbounds.entry(payment_id) {
15471547
hash_map::Entry::Occupied(_) => Err(PaymentSendFailure::DuplicatePayment),
15481548
hash_map::Entry::Vacant(entry) => {
1549-
let (payment, onion_session_privs) = self.create_pending_payment(
1549+
let (payment, onion_session_privs) = Self::create_pending_payment(
15501550
payment_hash, recipient_onion, keysend_preimage, route, retry_strategy,
15511551
payment_params, entropy_source, best_block_height
15521552
);
@@ -1557,7 +1557,7 @@ impl OutboundPayments {
15571557
}
15581558

15591559
fn create_pending_payment<ES: Deref>(
1560-
&self, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
1560+
payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
15611561
keysend_preimage: Option<PaymentPreimage>, route: &Route, retry_strategy: Option<Retry>,
15621562
payment_params: Option<PaymentParameters>, entropy_source: &ES, best_block_height: u32
15631563
) -> (PendingOutboundPayment, Vec<[u8; 32]>)

0 commit comments

Comments
 (0)