@@ -448,10 +448,10 @@ pub(super) struct Channel<Signer: Sign> {
448
448
#[ cfg( any( test, feature = "fuzztarget" ) ) ]
449
449
// When receive an HTLC fulfill on an outbound path, we may immediately fulfill the
450
450
// corresponding HTLC on the inbound path. If, then, the outbound path channel is
451
- // disconnected and reconnected, they may re-broadcast their update_fulfill_htlc,
452
- // causing a double-claim. This is fine, but as a sanity check in our failure to
453
- // generate the second claim, we check here that the original was a claim, and that we
454
- // aren't now trying to fulfill a failed HTLC.
451
+ // disconnected and reconnected (before we've exchange commitment_signed and revoke_and_ack
452
+ // messages), they may re-broadcast their update_fulfill_htlc, causing a duplicate claim. This
453
+ // is fine, but as a sanity check in our failure to generate the second claim, we check here
454
+ // that the original was a claim, and that we aren't now trying to fulfill a failed HTLC.
455
455
historical_inbound_htlc_fulfills : HashSet < u64 > ,
456
456
}
457
457
@@ -1279,6 +1279,8 @@ impl<Signer: Sign> Channel<Signer> {
1279
1279
}
1280
1280
if pending_idx == core:: usize:: MAX {
1281
1281
#[ cfg( any( test, feature = "fuzztarget" ) ) ]
1282
+ // If we failed to find an HTLC to fulfill, make sure it was previously fulfilled and
1283
+ // this is simply a duplicate claim, not previously failed and we lost funds.
1282
1284
debug_assert ! ( self . historical_inbound_htlc_fulfills. contains( & htlc_id_arg) ) ;
1283
1285
return Ok ( ( None , None ) ) ;
1284
1286
}
0 commit comments