@@ -7208,12 +7208,10 @@ where
7208
7208
}).collect();
7209
7209
let pending_mpp_claim_ptr_opt = if sources.len() > 1 {
7210
7210
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);
7217
7215
}
7218
7216
}
7219
7217
Some(Arc::new(Mutex::new(PendingMPPClaim {
@@ -14791,6 +14789,9 @@ where
14791
14789
let mut channels_without_preimage = payment_claim.mpp_parts.iter()
14792
14790
.map(|htlc_info| (htlc_info.counterparty_node_id, htlc_info.funding_txo, htlc_info.channel_id))
14793
14791
.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.
14794
14795
channels_without_preimage.sort_unstable();
14795
14796
channels_without_preimage.dedup();
14796
14797
let pending_claims = PendingMPPClaim {
0 commit comments