| 532 | } |
| 533 | |
| 534 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 535 | { |
| 536 | struct htlc_stub htlc; |
| 537 | |
| 538 | if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) { |
| 539 | channel_internal_error(channel, "Invalid onchain_htlc_timeout"); |
| 540 | return; |
| 541 | } |
| 542 | |
| 543 | /* It should tell us about timeouts on our LOCAL htlcs */ |
| 544 | if (htlc.owner != LOCAL) { |
| 545 | channel_internal_error(channel, |
| 546 | "onchaind_htlc_timeout: htlc %"PRIu64" is not local!", |
| 547 | htlc.id); |
| 548 | return; |
| 549 | } |
| 550 | |
| 551 | /* BOLT #5: |
| 552 | * |
| 553 | * - if the commitment transaction HTLC output has *timed out* and |
| 554 | * hasn't been *resolved*: |
| 555 | * - MUST *resolve* the output by spending it using the HTLC-timeout |
| 556 | * transaction. |
| 557 | */ |
| 558 | onchain_failed_our_htlc(channel, &htlc, "timed out", true); |
| 559 | } |
| 560 | |
| 561 | static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED) |
| 562 | { |
no test coverage detected