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

Function handle_onchain_htlc_timeout

lightningd/onchain_control.c:511–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
512{
513 struct htlc_stub htlc;
514
515 if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) {
516 channel_internal_error(channel, "Invalid onchain_htlc_timeout");
517 return;
518 }
519
520 /* It should tell us about timeouts on our LOCAL htlcs */
521 if (htlc.owner != LOCAL) {
522 channel_internal_error(channel,
523 "onchaind_htlc_timeout: htlc %"PRIu64" is not local!",
524 htlc.id);
525 return;
526 }
527
528 /* BOLT #5:
529 *
530 * - if the commitment transaction HTLC output has *timed out* and
531 * hasn't been *resolved*:
532 * - MUST *resolve* the output by spending it using the HTLC-timeout
533 * transaction.
534 */
535 onchain_failed_our_htlc(channel, &htlc, "timed out", true);
536}
537
538static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED)
539{

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