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

Function handle_onchain_htlc_timeout

lightningd/onchain_control.c:534–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
535{
536 struct htlc_stub htlc;
537
538 if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) {
539 channel_internal_error(channel, "Invalid onchain_htlc_timeout");
540 return;
541 }
542
543 /* It should tell us about timeouts on our LOCAL htlcs */
544 if (htlc.owner != LOCAL) {
545 channel_internal_error(channel,
546 "onchaind_htlc_timeout: htlc %"PRIu64" is not local!",
547 htlc.id);
548 return;
549 }
550
551 /* BOLT #5:
552 *
553 * - if the commitment transaction HTLC output has *timed out* and
554 * hasn't been *resolved*:
555 * - MUST *resolve* the output by spending it using the HTLC-timeout
556 * transaction.
557 */
558 onchain_failed_our_htlc(channel, &htlc, "timed out", true);
559}
560
561static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED)
562{

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