@@ -3307,9 +3307,13 @@ pub enum RecentPaymentDetails {
33073307 /// Hash of the payment that is currently being sent but has yet to be fulfilled or
33083308 /// abandoned.
33093309 payment_hash: PaymentHash,
3310- /// Total amount (in msat, excluding fees) across all paths for this payment,
3310+ /// Total amount (excluding fees) across all paths for this payment,
33113311 /// not just the amount currently inflight.
33123312 total_msat: u64,
3313+ /// Total routing fees of the HTLCs currently in-flight for this payment.
3314+ ///
3315+ /// `None` for payments serialized by LDK versions prior to 0.0.103.
3316+ pending_fee_msat: Option<u64>,
33133317 /// Whether this payment is a liquidity probe.
33143318 is_probe: bool,
33153319 },
@@ -3326,6 +3330,13 @@ pub enum RecentPaymentDetails {
33263330 /// Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
33273331 /// made before LDK version 0.0.104.
33283332 payment_hash: Option<PaymentHash>,
3333+ /// Total routing fees paid for this payment, as also reported via the `fee_paid_msat`
3334+ /// field of [`Event::PaymentSent`].
3335+ ///
3336+ /// `None` for payments serialized by LDK versions prior to 0.3.0.
3337+ ///
3338+ /// [`Event::PaymentSent`]: events::Event::PaymentSent
3339+ fee_paid_msat: Option<u64>,
33293340 },
33303341 /// After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
33313342 /// abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
@@ -4134,12 +4145,13 @@ impl<
41344145 PendingOutboundPayment::StaticInvoiceReceived { .. } => {
41354146 Some(RecentPaymentDetails::AwaitingInvoice { payment_id: *payment_id })
41364147 },
4137- PendingOutboundPayment::Retryable { payment_hash, total_msat, .. } => {
4148+ PendingOutboundPayment::Retryable { payment_hash, total_msat, pending_fee_msat, .. } => {
41384149 let is_probe = outbound_payment::payment_is_probe(payment_hash, payment_id, self.probing_cookie_secret);
41394150 Some(RecentPaymentDetails::Pending {
41404151 payment_id: *payment_id,
41414152 payment_hash: *payment_hash,
41424153 total_msat: *total_msat,
4154+ pending_fee_msat: *pending_fee_msat,
41434155 is_probe,
41444156 })
41454157 },
@@ -4151,8 +4163,12 @@ impl<
41514163 is_probe,
41524164 })
41534165 },
4154- PendingOutboundPayment::Fulfilled { payment_hash, .. } => {
4155- Some(RecentPaymentDetails::Fulfilled { payment_id: *payment_id, payment_hash: *payment_hash })
4166+ PendingOutboundPayment::Fulfilled { payment_hash, fee_paid_msat, .. } => {
4167+ Some(RecentPaymentDetails::Fulfilled {
4168+ payment_id: *payment_id,
4169+ payment_hash: *payment_hash,
4170+ fee_paid_msat: *fee_paid_msat,
4171+ })
41564172 },
41574173 PendingOutboundPayment::Legacy { .. } => None
41584174 })
0 commit comments