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

Function handle_missing_htlc_output

lightningd/onchain_control.c:386–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386static void handle_missing_htlc_output(struct channel *channel, const u8 *msg)
387{
388 struct htlc_stub htlc;
389
390 if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) {
391 channel_internal_error(channel, "Invalid missing_htlc_output");
392 return;
393 }
394
395 /* We only set tell_if_missing on LOCAL htlcs */
396 if (htlc.owner != LOCAL) {
397 channel_internal_error(channel,
398 "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!",
399 htlc.id);
400 return;
401 }
402
403 /* BOLT #5:
404 *
405 * - for any committed HTLC that does NOT have an output in this
406 * commitment transaction:
407 * - once the commitment transaction has reached reasonable depth:
408 * - MUST fail the corresponding incoming HTLC (if any).
409 * - if no *valid* commitment transaction contains an output
410 * corresponding to the HTLC.
411 * - MAY fail the corresponding incoming HTLC sooner.
412 */
413 onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false);
414}
415
416static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg)
417{

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