Skip to content

Commit cc60aa8

Browse files
committed
Rename OutboundPayments::retry_payment_internal
It will be used for initial attempts at paying BOLT 12 invoices, so rename it something that covers both that and retries.
1 parent f00c4af commit cc60aa8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl OutboundPayments {
711711
}
712712
core::mem::drop(outbounds);
713713
if let Some((payment_hash, payment_id, route_params)) = retry_id_route_params {
714-
self.retry_payment_internal(payment_hash, payment_id, route_params, router, first_hops(), &inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, &send_payment_along_path)
714+
self.find_route_and_send_payment(payment_hash, payment_id, route_params, router, first_hops(), &inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, &send_payment_along_path)
715715
} else { break }
716716
}
717717

@@ -797,7 +797,7 @@ impl OutboundPayments {
797797
Ok(())
798798
}
799799

800-
fn retry_payment_internal<R: Deref, NS: Deref, ES: Deref, IH, SP, L: Deref>(
800+
fn find_route_and_send_payment<R: Deref, NS: Deref, ES: Deref, IH, SP, L: Deref>(
801801
&self, payment_hash: PaymentHash, payment_id: PaymentId, route_params: RouteParameters,
802802
router: &R, first_hops: Vec<ChannelDetails>, inflight_htlcs: &IH, entropy_source: &ES,
803803
node_signer: &NS, best_block_height: u32, logger: &L,
@@ -950,14 +950,14 @@ impl OutboundPayments {
950950
match err {
951951
PaymentSendFailure::AllFailedResendSafe(errs) => {
952952
Self::push_path_failed_evs_and_scids(payment_id, payment_hash, &mut route_params, route.paths, errs.into_iter().map(|e| Err(e)), logger, pending_events);
953-
self.retry_payment_internal(payment_hash, payment_id, route_params, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path);
953+
self.find_route_and_send_payment(payment_hash, payment_id, route_params, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path);
954954
},
955955
PaymentSendFailure::PartialFailure { failed_paths_retry: Some(mut retry), results, .. } => {
956956
Self::push_path_failed_evs_and_scids(payment_id, payment_hash, &mut retry, route.paths, results.into_iter(), logger, pending_events);
957957
// Some paths were sent, even if we failed to send the full MPP value our recipient may
958958
// misbehave and claim the funds, at which point we have to consider the payment sent, so
959959
// return `Ok()` here, ignoring any retry errors.
960-
self.retry_payment_internal(payment_hash, payment_id, retry, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path);
960+
self.find_route_and_send_payment(payment_hash, payment_id, retry, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path);
961961
},
962962
PaymentSendFailure::PartialFailure { failed_paths_retry: None, .. } => {
963963
// This may happen if we send a payment and some paths fail, but only due to a temporary
@@ -1659,7 +1659,7 @@ mod tests {
16591659
PaymentId([0; 32]), None, &Route { paths: vec![], payment_params: None },
16601660
Some(Retry::Attempts(1)), Some(expired_route_params.payment_params.clone()),
16611661
&&keys_manager, 0).unwrap();
1662-
outbound_payments.retry_payment_internal(
1662+
outbound_payments.find_route_and_send_payment(
16631663
PaymentHash([0; 32]), PaymentId([0; 32]), expired_route_params, &&router, vec![],
16641664
&|| InFlightHtlcs::new(), &&keys_manager, &&keys_manager, 0, &&logger, &pending_events,
16651665
&|_| Ok(()));
@@ -1706,7 +1706,7 @@ mod tests {
17061706
PaymentId([0; 32]), None, &Route { paths: vec![], payment_params: None },
17071707
Some(Retry::Attempts(1)), Some(route_params.payment_params.clone()),
17081708
&&keys_manager, 0).unwrap();
1709-
outbound_payments.retry_payment_internal(
1709+
outbound_payments.find_route_and_send_payment(
17101710
PaymentHash([0; 32]), PaymentId([0; 32]), route_params, &&router, vec![],
17111711
&|| InFlightHtlcs::new(), &&keys_manager, &&keys_manager, 0, &&logger, &pending_events,
17121712
&|_| Ok(()));

0 commit comments

Comments
 (0)