Skip to content

Commit df32a24

Browse files
committed
Mark ChannelManager::send_payment_with_route as deprecated
We probably should have done this long ago a release or two after adding `send_payment`, but we didn't and the second best time is now. `send_payment_with_route` has particularly hard to use retry semantics that make it unsuitable for real use. Once we get the last of our users off of it, we'll want to remove it (or at least mark it test-only), but we should start by deprecating it.
1 parent 50d21b7 commit df32a24

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/ln/channelmanager.rs

+5
Original file line numberDiff line numberDiff line change
@@ -4093,6 +4093,10 @@ where
40934093

40944094
/// Sends a payment along a given route.
40954095
///
4096+
/// This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the
4097+
/// route for a payment, do so by matching the [`PaymentId`] passed to
4098+
/// [`Router::find_route_with_id`].
4099+
///
40964100
/// Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
40974101
/// fields for more info.
40984102
///
@@ -4142,6 +4146,7 @@ where
41424146
/// [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
41434147
/// [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
41444148
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
4149+
#[cfg_attr(not(any(test, feature = "_test_utils")), deprecated(note = "Use `send_payment` instead"))]
41454150
pub fn send_payment_with_route(&self, route: &Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_id: PaymentId) -> Result<(), PaymentSendFailure> {
41464151
let best_block_height = self.best_block.read().unwrap().height;
41474152
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);

0 commit comments

Comments
 (0)