From afdaa64b44f619df3cc01c5682b9a47defdca103 Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Sun, 18 Dec 2022 20:34:34 -0500 Subject: [PATCH] Rename send_payment and retry_payment for retries Once ChannelManager supports payment retries, it will make more sense for its current send_payment method to be named send_payment_with_route because retrying should be the default. Here we get a head start on this by making the rename in outbound_payment, but not changing the public interface yet. --- lightning/src/ln/channelmanager.rs | 4 ++-- lightning/src/ln/outbound_payment.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 61cc2af81..2c7a383c5 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -2370,7 +2370,7 @@ impl ChannelManager, payment_id: PaymentId) -> Result<(), PaymentSendFailure> { let best_block_height = self.best_block.read().unwrap().height(); self.pending_outbound_payments - .send_payment(route, payment_hash, payment_secret, payment_id, &self.keys_manager, best_block_height, + .send_payment_with_route(route, payment_hash, payment_secret, payment_id, &self.keys_manager, best_block_height, |path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv| self.send_payment_along_path(path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv)) } @@ -2402,7 +2402,7 @@ impl ChannelManager Result<(), PaymentSendFailure> { let best_block_height = self.best_block.read().unwrap().height(); - self.pending_outbound_payments.retry_payment(route, payment_id, &self.keys_manager, best_block_height, + self.pending_outbound_payments.retry_payment_with_route(route, payment_id, &self.keys_manager, best_block_height, |path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv| self.send_payment_along_path(path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv)) } diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index 60c111b27..95ad59e63 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -271,7 +271,7 @@ impl OutboundPayments { } } - pub(super) fn send_payment( + pub(super) fn send_payment_with_route( &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, payment_id: PaymentId, keys_manager: &K, best_block_height: u32, send_payment_along_path: F ) -> Result<(), PaymentSendFailure> @@ -306,7 +306,7 @@ impl OutboundPayments { } } - pub(super) fn retry_payment( + pub(super) fn retry_payment_with_route( &self, route: &Route, payment_id: PaymentId, keys_manager: &K, best_block_height: u32, send_payment_along_path: F ) -> Result<(), PaymentSendFailure> -- 2.39.5