@@ -120,11 +120,14 @@ static bool tell_if_missing(const struct channel *channel,
120120 *
121121 * - for any committed HTLC that does NOT have an output in this
122122 * commitment transaction:
123- * - once the commitment transaction has reached reasonable depth:
124- * - MUST fail the corresponding incoming HTLC (if any).
125- * - if no *valid* commitment transaction contains an output
126- * corresponding to the HTLC.
127- * - MAY fail the corresponding incoming HTLC sooner.
123+ * - if the payment preimage is known:
124+ * - MUST fulfill the corresponding incoming HTLC (if any).
125+ * - otherwise:
126+ * - once the commitment transaction has reached reasonable depth:
127+ * - MUST fail the corresponding incoming HTLC (if any).
128+ * - if no *valid* commitment transaction contains an output
129+ * corresponding to the HTLC:
130+ * - MAY fail the corresponding incoming HTLC sooner.
128131 */
129132 if (hout -> hstate >= RCVD_ADD_REVOCATION
130133 && hout -> hstate < SENT_REMOVE_REVOCATION )
@@ -484,12 +487,16 @@ static void handle_missing_htlc_output(struct channel *channel, const u8 *msg)
484487 *
485488 * - for any committed HTLC that does NOT have an output in this
486489 * commitment transaction:
487- * - once the commitment transaction has reached reasonable depth:
488- * - MUST fail the corresponding incoming HTLC (if any).
489- * - if no *valid* commitment transaction contains an output
490- * corresponding to the HTLC.
491- * - MAY fail the corresponding incoming HTLC sooner.
490+ * - if the payment preimage is known:
491+ * - MUST fulfill the corresponding incoming HTLC (if any).
492+ * - otherwise:
493+ * - once the commitment transaction has reached reasonable depth:
494+ * - MUST fail the corresponding incoming HTLC (if any).
495+ * - if no *valid* commitment transaction contains an output
496+ * corresponding to the HTLC:
497+ * - MAY fail the corresponding incoming HTLC sooner.
492498 */
499+ /* Note: we already succeeded any incoming which we preimage for */
493500 onchain_failed_our_htlc (channel , & htlc , "missing in commitment tx" , false);
494501}
495502
0 commit comments