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

Function handle_onchain_htlc_timeout

lightningd/onchain_control.c:416–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
417{
418 struct htlc_stub htlc;
419
420 if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) {
421 channel_internal_error(channel, "Invalid onchain_htlc_timeout");
422 return;
423 }
424
425 /* It should tell us about timeouts on our LOCAL htlcs */
426 if (htlc.owner != LOCAL) {
427 channel_internal_error(channel,
428 "onchaind_htlc_timeout: htlc %"PRIu64" is not local!",
429 htlc.id);
430 return;
431 }
432
433 /* BOLT #5:
434 *
435 * - if the commitment transaction HTLC output has *timed out* and
436 * hasn't been *resolved*:
437 * - MUST *resolve* the output by spending it using the HTLC-timeout
438 * transaction.
439 */
440 onchain_failed_our_htlc(channel, &htlc, "timed out", true);
441}
442
443static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED)
444{

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