@@ -7208,12 +7208,10 @@ where
72087208 }).collect();
72097209 let pending_mpp_claim_ptr_opt = if sources.len() > 1 {
72107210 let mut channels_without_preimage = Vec::with_capacity(mpp_parts.len());
7211- for source in sources.iter() {
7212- if let Some(cp_id) = source.prev_hop.counterparty_node_id {
7213- let chan = (cp_id, source.prev_hop.outpoint, source.prev_hop.channel_id);
7214- if !channels_without_preimage.contains(&chan) {
7215- channels_without_preimage.push(chan);
7216- }
7211+ for part in mpp_parts.iter() {
7212+ let chan = (part.counterparty_node_id, part.funding_txo, part.channel_id);
7213+ if !channels_without_preimage.contains(&chan) {
7214+ channels_without_preimage.push(chan);
72177215 }
72187216 }
72197217 Some(Arc::new(Mutex::new(PendingMPPClaim {
@@ -14791,6 +14789,9 @@ where
1479114789 let mut channels_without_preimage = payment_claim.mpp_parts.iter()
1479214790 .map(|htlc_info| (htlc_info.counterparty_node_id, htlc_info.funding_txo, htlc_info.channel_id))
1479314791 .collect::<Vec<_>>();
14792+ // If we have multiple MPP parts which were received over the same channel,
14793+ // we only track it once as once we get a preimage durably in the
14794+ // `ChannelMonitor` it will be used for all HTLCs with a matching hash.
1479414795 channels_without_preimage.sort_unstable();
1479514796 channels_without_preimage.dedup();
1479614797 let pending_claims = PendingMPPClaim {
0 commit comments