| 475 | } |
| 476 | |
| 477 | static void handle_missing_htlc_output(struct channel *channel, const u8 *msg) |
| 478 | { |
| 479 | struct htlc_stub htlc; |
| 480 | |
| 481 | if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) { |
| 482 | channel_internal_error(channel, "Invalid missing_htlc_output"); |
| 483 | return; |
| 484 | } |
| 485 | |
| 486 | /* We only set tell_if_missing on LOCAL htlcs */ |
| 487 | if (htlc.owner != LOCAL) { |
| 488 | channel_internal_error(channel, |
| 489 | "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!", |
| 490 | htlc.id); |
| 491 | return; |
| 492 | } |
| 493 | |
| 494 | /* BOLT #5: |
| 495 | * |
| 496 | * - for any committed HTLC that does NOT have an output in this |
| 497 | * commitment transaction: |
| 498 | * - if the payment preimage is known: |
| 499 | * - MUST fulfill the corresponding incoming HTLC (if any). |
| 500 | * - otherwise: |
| 501 | * - once the commitment transaction has reached reasonable depth: |
| 502 | * - MUST fail the corresponding incoming HTLC (if any). |
| 503 | * - if no *valid* commitment transaction contains an output |
| 504 | * corresponding to the HTLC: |
| 505 | * - MAY fail the corresponding incoming HTLC sooner. |
| 506 | */ |
| 507 | /* Note: we already succeeded any incoming which we preimage for */ |
| 508 | onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false); |
| 509 | } |
| 510 | |
| 511 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 512 | { |
no test coverage detected