@@ -1140,8 +1140,8 @@ pub enum RecentPaymentDetails {
1140
1140
/// Hash of the payment that is currently being sent but has yet to be fulfilled or
1141
1141
/// abandoned.
1142
1142
payment_hash : PaymentHash ,
1143
- /// Total amount (in msat) across all paths for this payment, not just the amount currently
1144
- /// inflight.
1143
+ /// Total amount (in msat, excluding fees ) across all paths for this payment,
1144
+ /// not just the amount currently inflight.
1145
1145
total_msat : u64 ,
1146
1146
} ,
1147
1147
/// When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
@@ -2452,6 +2452,8 @@ where
2452
2452
/// Value parameters are provided via the last hop in route, see documentation for RouteHop
2453
2453
/// fields for more info.
2454
2454
///
2455
+ /// # Avoiding Duplicate Payments
2456
+ ///
2455
2457
/// If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
2456
2458
/// method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
2457
2459
/// is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
@@ -2464,12 +2466,19 @@ where
2464
2466
/// consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
2465
2467
/// [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
2466
2468
///
2469
+ /// Additionally, in the scenario where we begin the process of sending a payment, but crash
2470
+ /// before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
2471
+ /// using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
2472
+ /// [`ChannelManager::list_recent_payments`] for more information.
2473
+ ///
2467
2474
/// May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via
2468
2475
/// [`PeerManager::process_events`]).
2469
2476
///
2477
+ /// # Possible Error States on PaymentSendFailure
2478
+ ///
2470
2479
/// Each path may have a different return value, and PaymentSendValue may return a Vec with
2471
2480
/// each entry matching the corresponding-index entry in the route paths, see
2472
- /// PaymentSendFailure for more info.
2481
+ /// [` PaymentSendFailure`] for more info.
2473
2482
///
2474
2483
/// In general, a path may raise:
2475
2484
/// * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
@@ -2484,20 +2493,17 @@ where
2484
2493
/// irrevocably committed to on our end. In such a case, do NOT retry the payment with a
2485
2494
/// different route unless you intend to pay twice!
2486
2495
///
2487
- /// Thus, in order to ensure duplicate payments are not sent, if we begin the process of sending
2488
- /// a payment, but crash before `send_payment` returns (or prior to [`ChannelMonitorUpdate`]
2489
- /// persistence if you're using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be
2490
- /// lost on restart. See [`ChannelManager::list_recent_payments`] for more information.
2496
+ /// # A caution on `payment_secret`
2491
2497
///
2492
- /// payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
2493
- /// the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
2494
- /// newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
2495
- /// must not contain multiple paths as multi-path payments require a recipient-provided
2496
- /// payment_secret.
2498
+ /// ` payment_secret` is unrelated to ` payment_hash` (or [` PaymentPreimage`] ) and exists to
2499
+ /// authenticate the sender to the recipient and prevent payment-probing (deanonymization)
2500
+ /// attacks. For newer nodes, it will be provided to you in the invoice. If you do not have one,
2501
+ /// the Route must not contain multiple paths as multi-path payments require a
2502
+ /// recipient-provided ` payment_secret` .
2497
2503
///
2498
- /// If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
2499
- /// bit set (either as required or as available). If multiple paths are present in the Route,
2500
- /// we assume the invoice had the basic_mpp feature set.
2504
+ /// If a ` payment_secret` *is* provided, we assume that the invoice had the payment_secret
2505
+ /// feature bit set (either as required or as available). If multiple paths are present in the
2506
+ /// Route, we assume the invoice had the basic_mpp feature set.
2501
2507
///
2502
2508
/// [`Event::PaymentSent`]: events::Event::PaymentSent
2503
2509
/// [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
0 commit comments