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

Function handle_missing_htlc_output

lightningd/onchain_control.c:500–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500static void handle_missing_htlc_output(struct channel *channel, const u8 *msg)
501{
502 struct htlc_stub htlc;
503
504 if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) {
505 channel_internal_error(channel, "Invalid missing_htlc_output");
506 return;
507 }
508
509 /* We only set tell_if_missing on LOCAL htlcs */
510 if (htlc.owner != LOCAL) {
511 channel_internal_error(channel,
512 "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!",
513 htlc.id);
514 return;
515 }
516
517 /* BOLT #5:
518 *
519 * - for any committed HTLC that does NOT have an output in this
520 * commitment transaction:
521 * - if the payment preimage is known:
522 * - MUST fulfill the corresponding incoming HTLC (if any).
523 * - otherwise:
524 * - once the commitment transaction has reached reasonable depth:
525 * - MUST fail the corresponding incoming HTLC (if any).
526 * - if no *valid* commitment transaction contains an output
527 * corresponding to the HTLC:
528 * - MAY fail the corresponding incoming HTLC sooner.
529 */
530 /* Note: we already succeeded any incoming which we preimage for */
531 onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false);
532}
533
534static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
535{

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