| 498 | } |
| 499 | |
| 500 | static void handle_missing_htlc_output(struct channel *channel, const u8 *msg) |
| 501 | { |
| 502 | struct htlc_stub htlc; |
| 503 | |
| 504 | if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) { |
| 505 | channel_internal_error(channel, "Invalid missing_htlc_output"); |
| 506 | return; |
| 507 | } |
| 508 | |
| 509 | /* We only set tell_if_missing on LOCAL htlcs */ |
| 510 | if (htlc.owner != LOCAL) { |
| 511 | channel_internal_error(channel, |
| 512 | "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!", |
| 513 | htlc.id); |
| 514 | return; |
| 515 | } |
| 516 | |
| 517 | /* BOLT #5: |
| 518 | * |
| 519 | * - for any committed HTLC that does NOT have an output in this |
| 520 | * commitment transaction: |
| 521 | * - if the payment preimage is known: |
| 522 | * - MUST fulfill the corresponding incoming HTLC (if any). |
| 523 | * - otherwise: |
| 524 | * - once the commitment transaction has reached reasonable depth: |
| 525 | * - MUST fail the corresponding incoming HTLC (if any). |
| 526 | * - if no *valid* commitment transaction contains an output |
| 527 | * corresponding to the HTLC: |
| 528 | * - MAY fail the corresponding incoming HTLC sooner. |
| 529 | */ |
| 530 | /* Note: we already succeeded any incoming which we preimage for */ |
| 531 | onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false); |
| 532 | } |
| 533 | |
| 534 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 535 | { |
no test coverage detected