Skip to content

Commit 4085b22

Browse files
Document error conditions of outbound_payment::pay_internal
1 parent 46b22a9 commit 4085b22

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,19 @@ impl OutboundPayments {
532532
}
533533
}
534534

535+
/// Errors with no attempt at payment if the route parameters have expired, we failed to find a
536+
/// route to the destination, or we're attempting a retry when retries have been exhausted.
537+
///
538+
/// Otherwise, we'll attempt a payment over the route we've found and may recursively retry, but
539+
/// we'll end up erroring if:
540+
/// * the route we found is invalid
541+
/// * all channels in the route were unavailable at sending time
542+
/// and our retries have been exhausted.
543+
///
544+
/// Erroring in this method indicates that no HTLCs have been irrevocably committed to.
545+
///
546+
/// Note that we return `Ok(())` if some payment paths succeeded but some failed (and no retries
547+
/// remain) because it is possible that the payment may complete later, so resending is unsafe.
535548
fn pay_internal<R: Deref, NS: Deref, ES: Deref, F, L: Deref>(
536549
&self, payment_id: PaymentId,
537550
initial_send_info: Option<(PaymentHash, &Option<PaymentSecret>, Option<PaymentPreimage>, Retry)>,

0 commit comments

Comments
 (0)