@@ -1701,9 +1701,11 @@ where
1701
1701
/// Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
1702
1702
/// successful path, or have unresolved HTLCs.
1703
1703
///
1704
- /// This can be useful for figuring out whether or not a payment needs to be retried.
1705
- /// In general, if it is not listed here, you should consider retrying it if not
1706
- /// [`RecentPaymentDetails::Fulfilled`].
1704
+ /// This can be useful for payments that may have been prepared, but ultimately not sent, as a
1705
+ /// result of a crash. If such a payment exists, is not listed here, and an
1706
+ /// [`Event::PaymentSent`] event has yet to be received, you may consider retrying the payment.
1707
+ ///
1708
+ /// [`Event::PaymentSent`]: events::Event::PaymentSent
1707
1709
pub fn list_recent_payments ( & self ) -> Vec < RecentPaymentDetails > {
1708
1710
self . pending_outbound_payments . pending_outbound_payments . lock ( ) . unwrap ( ) . iter ( )
1709
1711
. filter_map ( |( _, pending_outbound_payment) | match pending_outbound_payment {
@@ -2482,6 +2484,11 @@ where
2482
2484
/// irrevocably committed to on our end. In such a case, do NOT retry the payment with a
2483
2485
/// different route unless you intend to pay twice!
2484
2486
///
2487
+ /// Additionally, if the process of sending a payment begins, but we crash before send_payment
2488
+ /// returns (or prior to MonitorUpdate completion if you're using
2489
+ /// [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
2490
+ /// [`ChannelManager::list_recent_payments`] for more information.
2491
+ ///
2485
2492
/// payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
2486
2493
/// the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
2487
2494
/// newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
@@ -2494,6 +2501,7 @@ where
2494
2501
///
2495
2502
/// [`Event::PaymentSent`]: events::Event::PaymentSent
2496
2503
/// [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
2504
+ /// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
2497
2505
pub fn send_payment ( & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > , payment_id : PaymentId ) -> Result < ( ) , PaymentSendFailure > {
2498
2506
let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
2499
2507
self . pending_outbound_payments
0 commit comments