MCPcopy Create free account
hub / github.com/ElementsProject/lightning / handle_missing_htlc_output

Function handle_missing_htlc_output

lightningd/onchain_control.c:587–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587static void handle_missing_htlc_output(struct channel *channel, const u8 *msg)
588{
589 struct htlc_stub htlc;
590
591 if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) {
592 channel_internal_error(channel, "Invalid missing_htlc_output");
593 return;
594 }
595
596 /* We only set tell_if_missing on LOCAL htlcs */
597 if (htlc.owner != LOCAL) {
598 channel_internal_error(channel,
599 "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!",
600 htlc.id);
601 return;
602 }
603
604 /* BOLT #5:
605 *
606 * - for any committed HTLC that does NOT have an output in this
607 * commitment transaction:
608 * - if the payment preimage is known:
609 * - MUST fulfill the corresponding incoming HTLC (if any).
610 * - otherwise:
611 * - once the commitment transaction has reached reasonable depth:
612 * - MUST fail the corresponding incoming HTLC (if any).
613 * - if no *valid* commitment transaction contains an output
614 * corresponding to the HTLC:
615 * - MAY fail the corresponding incoming HTLC sooner.
616 */
617 /* Note: we already succeeded any incoming which we preimage for */
618 onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false);
619}
620
621static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
622{

Callers 1

onchain_msgFunction · 0.85

Calls 2

onchain_failed_our_htlcFunction · 0.85
channel_internal_errorFunction · 0.70

Tested by

no test coverage detected