| 585 | } |
| 586 | |
| 587 | static void handle_missing_htlc_output(struct channel *channel, const u8 *msg) |
| 588 | { |
| 589 | struct htlc_stub htlc; |
| 590 | |
| 591 | if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) { |
| 592 | channel_internal_error(channel, "Invalid missing_htlc_output"); |
| 593 | return; |
| 594 | } |
| 595 | |
| 596 | /* We only set tell_if_missing on LOCAL htlcs */ |
| 597 | if (htlc.owner != LOCAL) { |
| 598 | channel_internal_error(channel, |
| 599 | "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!", |
| 600 | htlc.id); |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | /* BOLT #5: |
| 605 | * |
| 606 | * - for any committed HTLC that does NOT have an output in this |
| 607 | * commitment transaction: |
| 608 | * - if the payment preimage is known: |
| 609 | * - MUST fulfill the corresponding incoming HTLC (if any). |
| 610 | * - otherwise: |
| 611 | * - once the commitment transaction has reached reasonable depth: |
| 612 | * - MUST fail the corresponding incoming HTLC (if any). |
| 613 | * - if no *valid* commitment transaction contains an output |
| 614 | * corresponding to the HTLC: |
| 615 | * - MAY fail the corresponding incoming HTLC sooner. |
| 616 | */ |
| 617 | /* Note: we already succeeded any incoming which we preimage for */ |
| 618 | onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false); |
| 619 | } |
| 620 | |
| 621 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 622 | { |
no test coverage detected