Skip to content

Commit

Permalink
Add additional docs for list_pending_payments
Browse files Browse the repository at this point in the history
  • Loading branch information
jurvis committed Dec 24, 2022
1 parent 93bf16b commit d626653
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,11 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
}

/// Gets a list of payments in random order that are currently pending resolution.
///
/// This can be useful for figuring out whether or not a payment made needs to be retried.
/// In general, if it is not listed here, you should consider retrying it with a caveat: if a
/// payment is returned as [`RecentPaymentDetails::Fulfilled`], you may retry it, but should
/// not.
pub fn list_pending_payments(&self) -> Vec<RecentPaymentDetails> {
self.pending_outbound_payments.pending_outbound_payments.lock().unwrap().iter()
.filter_map(|(_, pending_outbound_payment)| match pending_outbound_payment {
Expand Down

0 comments on commit d626653

Please sign in to comment.