]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Disambiguate send_payment_internal from pay_internal
authorValentine Wallace <vwallace@protonmail.com>
Tue, 24 Jan 2023 03:45:59 +0000 (22:45 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 25 Jan 2023 19:44:10 +0000 (14:44 -0500)
lightning/src/ln/outbound_payment.rs

index 2a6ff04abef951afe93ec9a69e7d5972cf23b486..8867b2e96ae14c3e75bb960d5dd9fa97ed10d746 100644 (file)
@@ -409,7 +409,7 @@ impl OutboundPayments {
                   u32, PaymentId, &Option<PaymentPreimage>, [u8; 32]) -> Result<(), APIError>
        {
                let onion_session_privs = self.add_new_pending_payment(payment_hash, *payment_secret, payment_id, route, Retry::Attempts(0), None, entropy_source, best_block_height)?;
-               self.send_payment_internal(route, payment_hash, payment_secret, None, payment_id, None,
+               self.pay_route_internal(route, payment_hash, payment_secret, None, payment_id, None,
                        onion_session_privs, node_signer, best_block_height, &send_payment_along_path)
                        .map_err(|e| { self.remove_outbound_if_all_failed(payment_id, &e); e })
        }
@@ -431,7 +431,7 @@ impl OutboundPayments {
                let payment_hash = PaymentHash(Sha256::hash(&preimage.0).into_inner());
                let onion_session_privs = self.add_new_pending_payment(payment_hash, None, payment_id, &route, Retry::Attempts(0), None, entropy_source, best_block_height)?;
 
-               match self.send_payment_internal(route, payment_hash, &None, Some(preimage), payment_id, None, onion_session_privs, node_signer, best_block_height, &send_payment_along_path) {
+               match self.pay_route_internal(route, payment_hash, &None, Some(preimage), payment_id, None, onion_session_privs, node_signer, best_block_height, &send_payment_along_path) {
                        Ok(()) => Ok(payment_hash),
                        Err(e) => {
                                self.remove_outbound_if_all_failed(payment_id, &e);
@@ -508,7 +508,7 @@ impl OutboundPayments {
 
                let res = if let Some((payment_hash, payment_secret, retry_strategy)) = initial_send_info {
                        let onion_session_privs = self.add_new_pending_payment(payment_hash, *payment_secret, payment_id, &route, retry_strategy, Some(route_params.clone()), entropy_source, best_block_height)?;
-                       self.send_payment_internal(&route, payment_hash, payment_secret, None, payment_id, None, onion_session_privs, node_signer, best_block_height, send_payment_along_path)
+                       self.pay_route_internal(&route, payment_hash, payment_secret, None, payment_id, None, onion_session_privs, node_signer, best_block_height, send_payment_along_path)
                } else {
                        self.retry_payment_with_route(&route, payment_id, entropy_source, node_signer, best_block_height, send_payment_along_path)
                };
@@ -617,7 +617,7 @@ impl OutboundPayments {
                                        })),
                        }
                };
-               self.send_payment_internal(route, payment_hash, &payment_secret, None, payment_id, Some(total_msat), onion_session_privs, node_signer, best_block_height, &send_payment_along_path)
+               self.pay_route_internal(route, payment_hash, &payment_secret, None, payment_id, Some(total_msat), onion_session_privs, node_signer, best_block_height, &send_payment_along_path)
        }
 
        pub(super) fn send_probe<ES: Deref, NS: Deref, F>(
@@ -643,7 +643,7 @@ impl OutboundPayments {
                let route = Route { paths: vec![hops], payment_params: None };
                let onion_session_privs = self.add_new_pending_payment(payment_hash, None, payment_id, &route, Retry::Attempts(0), None, entropy_source, best_block_height)?;
 
-               match self.send_payment_internal(&route, payment_hash, &None, None, payment_id, None, onion_session_privs, node_signer, best_block_height, &send_payment_along_path) {
+               match self.pay_route_internal(&route, payment_hash, &None, None, payment_id, None, onion_session_privs, node_signer, best_block_height, &send_payment_along_path) {
                        Ok(()) => Ok((payment_hash, payment_id)),
                        Err(e) => {
                                self.remove_outbound_if_all_failed(payment_id, &e);
@@ -696,7 +696,7 @@ impl OutboundPayments {
                }
        }
 
-       fn send_payment_internal<NS: Deref, F>(
+       fn pay_route_internal<NS: Deref, F>(
                &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
                keysend_preimage: Option<PaymentPreimage>, payment_id: PaymentId, recv_value_msat: Option<u64>,
                onion_session_privs: Vec<[u8; 32]>, node_signer: &NS, best_block_height: u32,
@@ -813,7 +813,7 @@ impl OutboundPayments {
                F: Fn(&Vec<RouteHop>, &Option<PaymentParameters>, &PaymentHash, &Option<PaymentSecret>, u64,
                   u32, PaymentId, &Option<PaymentPreimage>, [u8; 32]) -> Result<(), APIError>
        {
-               self.send_payment_internal(route, payment_hash, payment_secret, keysend_preimage, payment_id,
+               self.pay_route_internal(route, payment_hash, payment_secret, keysend_preimage, payment_id,
                        recv_value_msat, onion_session_privs, node_signer, best_block_height,
                        &send_payment_along_path)
                        .map_err(|e| { self.remove_outbound_if_all_failed(payment_id, &e); e })