@@ -402,7 +402,7 @@ impl OutboundHTLCState {
402402enum OutboundHTLCOutcome {
403403 /// We started always filling in the preimages here in 0.0.105, and the requirement
404404 /// that the preimages always be filled in was added in 0.2.
405- Success(PaymentPreimage, #[allow(dead_code)] Option<AttributionData>),
405+ Success(PaymentPreimage, Option<AttributionData>),
406406 Failure(HTLCFailReason),
407407}
408408
@@ -1181,7 +1181,7 @@ pub(super) struct MonitorRestoreUpdates {
11811181 pub order: RAACommitmentOrder,
11821182 pub accepted_htlcs: Vec<(PendingHTLCInfo, u64)>,
11831183 pub failed_htlcs: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>,
1184- pub finalized_claimed_htlcs: Vec<HTLCSource>,
1184+ pub finalized_claimed_htlcs: Vec<( HTLCSource, Option<AttributionData>) >,
11851185 pub pending_update_adds: Vec<msgs::UpdateAddHTLC>,
11861186 pub funding_broadcastable: Option<Transaction>,
11871187 pub channel_ready: Option<msgs::ChannelReady>,
@@ -2313,7 +2313,7 @@ where
23132313 // but need to handle this somehow or we run the risk of losing HTLCs!
23142314 monitor_pending_forwards: Vec<(PendingHTLCInfo, u64)>,
23152315 monitor_pending_failures: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>,
2316- monitor_pending_finalized_fulfills: Vec<HTLCSource>,
2316+ monitor_pending_finalized_fulfills: Vec<( HTLCSource, Option<AttributionData>) >,
23172317 monitor_pending_update_adds: Vec<msgs::UpdateAddHTLC>,
23182318 monitor_pending_tx_signatures: Option<msgs::TxSignatures>,
23192319
@@ -6749,7 +6749,7 @@ where
67496749
67506750 self.mark_outbound_htlc_removed(
67516751 msg.htlc_id,
6752- OutboundHTLCOutcome::Success(msg.payment_preimage, None ),
6752+ OutboundHTLCOutcome::Success(msg.payment_preimage, msg.attribution_data.clone() ),
67536753 )
67546754 .map(|htlc| {
67556755 (htlc.source.clone(), htlc.amount_msat, htlc.skimmed_fee_msat, htlc.send_timestamp)
@@ -7554,8 +7554,11 @@ where
75547554 });
75557555 revoked_htlcs.push((htlc.source.clone(), htlc.payment_hash, reason));
75567556 },
7557- OutboundHTLCOutcome::Success(..) => {
7558- finalized_claimed_htlcs.push(htlc.source.clone());
7557+ OutboundHTLCOutcome::Success(_, attribution_data) => {
7558+ // Even though a fast track was taken for fulfilled HTLCs to the incoming side, we still
7559+ // pass along attribution data here so that we can include hold time information in the
7560+ // final PaymentPathSuccessful events.
7561+ finalized_claimed_htlcs.push((htlc.source.clone(), attribution_data));
75597562 // They fulfilled, so we sent them money
75607563 value_to_self_msat_diff -= htlc.amount_msat as i64;
75617564 },
@@ -8048,7 +8051,7 @@ where
80488051 &mut self, resend_raa: bool, resend_commitment: bool, resend_channel_ready: bool,
80498052 mut pending_forwards: Vec<(PendingHTLCInfo, u64)>,
80508053 mut pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>,
8051- mut pending_finalized_claimed_htlcs: Vec<HTLCSource>,
8054+ mut pending_finalized_claimed_htlcs: Vec<( HTLCSource, Option<AttributionData>) >,
80528055 ) {
80538056 self.context.monitor_pending_revoke_and_ack |= resend_raa;
80548057 self.context.monitor_pending_commitment_signed |= resend_commitment;
0 commit comments