@@ -1209,19 +1209,28 @@ impl ChannelDetails {
1209
1209
pub enum PendingPaymentDetails {
1210
1210
/// When a payment is still being sent and awaiting successful delivery.
1211
1211
Retryable {
1212
+ /// Hash of the payment that is currently being sent but has yet to be fulfilled or
1213
+ /// abandoned.
1214
+ payment_hash : PaymentHash ,
1212
1215
/// Total amount (in msat) across all paths for this payment, not just the amount currently
1213
1216
/// inflight.
1214
- total_msat : u64
1217
+ total_msat : u64 ,
1215
1218
} ,
1216
1219
/// When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
1217
1220
/// been resolved. These payments will only cease being tracked upon receiving or handling
1218
1221
/// [`Event::PaymentSent`].
1219
- Fulfilled ,
1222
+ Fulfilled {
1223
+ /// Hash of the payment that was claimed.
1224
+ payment_hash : Option < PaymentHash > ,
1225
+ } ,
1220
1226
/// After a payment is explicitly abandoned by calling [`ChannelManager::abandon_payment`], they
1221
1227
/// are marked as abandoned until an [`Event::PaymentFailed`] event is generated. A payment
1222
1228
/// could also be marked as abandoned if pathfinding fails repeatedly and we will no longer
1223
1229
/// retry sending.
1224
- Abandoned ,
1230
+ Abandoned {
1231
+ /// Hash of the payment that we have given up trying to send.
1232
+ payment_hash : PaymentHash ,
1233
+ } ,
1225
1234
}
1226
1235
1227
1236
/// If a payment fails to send, it can be in one of several states. This enum is returned as the
@@ -1795,14 +1804,17 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
1795
1804
pub fn list_pending_payments ( & self ) -> Vec < PendingPaymentDetails > {
1796
1805
self . pending_outbound_payments . lock ( ) . unwrap ( ) . iter ( )
1797
1806
. filter_map ( |( _, pending_outbound_payment) | match pending_outbound_payment {
1798
- PendingOutboundPayment :: Retryable { total_msat, .. } => {
1799
- Some ( PendingPaymentDetails :: Retryable { total_msat : * total_msat } )
1807
+ PendingOutboundPayment :: Retryable { payment_hash, total_msat, .. } => {
1808
+ Some ( PendingPaymentDetails :: Retryable {
1809
+ payment_hash : * payment_hash,
1810
+ total_msat : * total_msat,
1811
+ } )
1800
1812
} ,
1801
- PendingOutboundPayment :: Abandoned { .. } => {
1802
- Some ( PendingPaymentDetails :: Abandoned )
1813
+ PendingOutboundPayment :: Abandoned { payment_hash , .. } => {
1814
+ Some ( PendingPaymentDetails :: Abandoned { payment_hash : * payment_hash } )
1803
1815
} ,
1804
- PendingOutboundPayment :: Fulfilled { .. } => {
1805
- Some ( PendingPaymentDetails :: Fulfilled )
1816
+ PendingOutboundPayment :: Fulfilled { payment_hash , .. } => {
1817
+ Some ( PendingPaymentDetails :: Fulfilled { payment_hash : * payment_hash } )
1806
1818
} ,
1807
1819
PendingOutboundPayment :: Legacy { .. } => None
1808
1820
} )
0 commit comments