Skip to content

Commit 8c4df02

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 a6f59a4 commit 8c4df02

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
@@ -3300,7 +3300,11 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
33003300
// The HTLC was not included in the confirmed commitment transaction,
33013301
// which has now reached ANTI_REORG_DELAY confirmations and thus the
33023302
// HTLC has been failed.
3303-
res.insert(source.clone(), candidate_htlc.payment_hash);
3303+
// However, if we have the preimage, the HTLC was fulfilled off-chain
3304+
// and should not be reported as failed.
3305+
if !us.counterparty_fulfilled_htlcs.contains_key(&htlc_id) {
3306+
res.insert(source.clone(), candidate_htlc.payment_hash);
3307+
}
33043308
}
33053309
}
33063310
};

0 commit comments

Comments
 (0)