@@ -3291,9 +3291,13 @@ pub enum RecentPaymentDetails {
32913291 /// Hash of the payment that is currently being sent but has yet to be fulfilled or
32923292 /// abandoned.
32933293 payment_hash: PaymentHash,
3294- /// Total amount (in msat, excluding fees) across all paths for this payment,
3294+ /// Total amount (excluding fees) across all paths for this payment,
32953295 /// not just the amount currently inflight.
32963296 total_msat: u64,
3297+ /// Total routing fees of the HTLCs currently in-flight for this payment.
3298+ ///
3299+ /// `None` for payments serialized by LDK versions prior to 0.0.103.
3300+ pending_fee_msat: Option<u64>,
32973301 /// Whether this payment is a liquidity probe.
32983302 is_probe: bool,
32993303 },
@@ -3310,6 +3314,13 @@ pub enum RecentPaymentDetails {
33103314 /// Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
33113315 /// made before LDK version 0.0.104.
33123316 payment_hash: Option<PaymentHash>,
3317+ /// Total routing fees paid for this payment, as also reported via the `fee_paid_msat`
3318+ /// field of [`Event::PaymentSent`].
3319+ ///
3320+ /// `None` for payments serialized by LDK versions prior to 0.3.0.
3321+ ///
3322+ /// [`Event::PaymentSent`]: events::Event::PaymentSent
3323+ fee_paid_msat: Option<u64>,
33133324 },
33143325 /// After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
33153326 /// abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
@@ -4118,12 +4129,13 @@ impl<
41184129 PendingOutboundPayment::StaticInvoiceReceived { .. } => {
41194130 Some(RecentPaymentDetails::AwaitingInvoice { payment_id: *payment_id })
41204131 },
4121- PendingOutboundPayment::Retryable { payment_hash, total_msat, .. } => {
4132+ PendingOutboundPayment::Retryable { payment_hash, total_msat, pending_fee_msat, .. } => {
41224133 let is_probe = outbound_payment::payment_is_probe(payment_hash, payment_id, self.probing_cookie_secret);
41234134 Some(RecentPaymentDetails::Pending {
41244135 payment_id: *payment_id,
41254136 payment_hash: *payment_hash,
41264137 total_msat: *total_msat,
4138+ pending_fee_msat: *pending_fee_msat,
41274139 is_probe,
41284140 })
41294141 },
@@ -4135,8 +4147,12 @@ impl<
41354147 is_probe,
41364148 })
41374149 },
4138- PendingOutboundPayment::Fulfilled { payment_hash, .. } => {
4139- Some(RecentPaymentDetails::Fulfilled { payment_id: *payment_id, payment_hash: *payment_hash })
4150+ PendingOutboundPayment::Fulfilled { payment_hash, fee_paid_msat, .. } => {
4151+ Some(RecentPaymentDetails::Fulfilled {
4152+ payment_id: *payment_id,
4153+ payment_hash: *payment_hash,
4154+ fee_paid_msat: *fee_paid_msat,
4155+ })
41404156 },
41414157 PendingOutboundPayment::Legacy { .. } => None
41424158 })
0 commit comments