Skip to content

Commit d34a273

Browse files
Filter claims from get_onchain_failed_htlcs return value
This isn't a bug at the moment because a claim in this situation would already be filtered out due to its inclusion in htlcs_resolved_to_user. However, when we stop issuing ReleasePaymentComplete monitor updates for claims in upcoming commits, HTLC claims will no longer be in htlcs_resolved_to_user when get_onchain_failed_htlcs checks.
1 parent 0838859 commit d34a273

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lightning/src/chain/channelmonitor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3301,7 +3301,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
33013301
// The HTLC was not included in the confirmed commitment transaction,
33023302
// which has now reached ANTI_REORG_DELAY confirmations and thus the
33033303
// HTLC has been failed.
3304-
res.insert(source.clone(), candidate_htlc.payment_hash);
3304+
// However, if we have the preimage, the HTLC was fulfilled off-chain
3305+
// and should not be reported as failed.
3306+
if !us.counterparty_fulfilled_htlcs.contains_key(&htlc_id) {
3307+
res.insert(source.clone(), candidate_htlc.payment_hash);
3308+
}
33053309
}
33063310
}
33073311
};

0 commit comments

Comments
 (0)