Skip to content

Commit 94fbc5f

Browse files
committed
f update to new api
1 parent 7ff7f2c commit 94fbc5f

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,8 +2417,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
24172417
/// an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
24182418
/// pending HTLCs for this payment.
24192419
///
2420+
/// Note that calling this method does *not* prevent a payment from succeeding. You must still
2421+
/// wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
2422+
/// determine the ultimate status of a payment.
2423+
///
24202424
/// [`retry_payment`]: Self::retry_payment
24212425
/// [`Event::PaymentFailed`]: events::Event::PaymentFailed
2426+
/// [`Event::PaymentSent`]: events::Event::PaymentSent
24222427
pub fn abandon_payment(&self, payment_id: PaymentId) {
24232428
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(&self.total_consistency_lock, &self.persistence_notifier);
24242429

lightning/src/ln/functional_test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ macro_rules! expect_payment_failed_conditions {
13051305
_ => panic!("Unexpected event"),
13061306
};
13071307
if !$conditions.expected_mpp_parts_remain {
1308-
$node.node.no_further_payment_retries(expected_payment_id);
1308+
$node.node.abandon_payment(expected_payment_id);
13091309
let events = $node.node.get_and_clear_pending_events();
13101310
assert_eq!(events.len(), 1);
13111311
match events[0] {
@@ -1633,7 +1633,7 @@ pub fn fail_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expe
16331633
_ => panic!("Unexpected event"),
16341634
}
16351635
if i == expected_paths.len() - 1 {
1636-
origin_node.node.no_further_payment_retries(our_payment_id);
1636+
origin_node.node.abandon_payment(our_payment_id);
16371637
let events = origin_node.node.get_and_clear_pending_events();
16381638
assert_eq!(events.len(), 1);
16391639
match events[0] {

lightning/src/util/events.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ pub enum Event {
234234
/// [`all_paths_failed`]: Self::all_paths_failed
235235
PaymentPathFailed {
236236
/// The id returned by [`ChannelManager::send_payment`] and used with
237-
/// [`ChannelManager::retry_payment`] and [`ChannelManager::no_further_payment_retries`].
237+
/// [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
238238
///
239239
/// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
240240
/// [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
241-
/// [`ChannelManager::no_further_payment_retries`]: crate::ln::channelmanager::ChannelManager::no_further_payment_retries
241+
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
242242
payment_id: Option<PaymentId>,
243243
/// The hash that was given to [`ChannelManager::send_payment`].
244244
///
@@ -269,12 +269,11 @@ pub enum Event {
269269
/// has an associated in-flight HTLC. See (1) for an example of such a failure.
270270
///
271271
/// If you wish to retry individual MPP parts and learn when a payment has failed, you must
272-
/// call [`ChannelManager::no_further_payment_retries`] and wait for a [`Event::PaymentFailed`]
273-
/// event.
272+
/// call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
274273
///
275274
/// (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
276275
///
277-
/// [`ChannelManager::no_further_payment_retries`]: crate::ln::channelmanager::ChannelManager::no_further_payment_retries
276+
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
278277
all_paths_failed: bool,
279278
/// The payment path that failed.
280279
path: Vec<RouteHop>,
@@ -300,17 +299,16 @@ pub enum Event {
300299
///
301300
/// This event is provided once there are no further pending HTLCs for the payment and the
302301
/// payment is no longer retryable, either due to a several-block timeout or because
303-
/// [`ChannelManager::no_further_payment_retries`] was previously called for the corresponding
304-
/// payment.
302+
/// [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
305303
///
306-
/// [`ChannelManager::no_further_payment_retries`]: crate::ln::channelmanager::ChannelManager::no_further_payment_retries
304+
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
307305
PaymentFailed {
308306
/// The id returned by [`ChannelManager::send_payment`] and used with
309-
/// [`ChannelManager::retry_payment`] and [`ChannelManager::no_further_payment_retries`].
307+
/// [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
310308
///
311309
/// [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
312310
/// [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
313-
/// [`ChannelManager::no_further_payment_retries`]: crate::ln::channelmanager::ChannelManager::no_further_payment_retries
311+
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
314312
payment_id: PaymentId,
315313
/// The hash that was given to [`ChannelManager::send_payment`].
316314
///

0 commit comments

Comments
 (0)