| 414 | } |
| 415 | |
| 416 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 417 | { |
| 418 | struct htlc_stub htlc; |
| 419 | |
| 420 | if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) { |
| 421 | channel_internal_error(channel, "Invalid onchain_htlc_timeout"); |
| 422 | return; |
| 423 | } |
| 424 | |
| 425 | /* It should tell us about timeouts on our LOCAL htlcs */ |
| 426 | if (htlc.owner != LOCAL) { |
| 427 | channel_internal_error(channel, |
| 428 | "onchaind_htlc_timeout: htlc %"PRIu64" is not local!", |
| 429 | htlc.id); |
| 430 | return; |
| 431 | } |
| 432 | |
| 433 | /* BOLT #5: |
| 434 | * |
| 435 | * - if the commitment transaction HTLC output has *timed out* and |
| 436 | * hasn't been *resolved*: |
| 437 | * - MUST *resolve* the output by spending it using the HTLC-timeout |
| 438 | * transaction. |
| 439 | */ |
| 440 | onchain_failed_our_htlc(channel, &htlc, "timed out", true); |
| 441 | } |
| 442 | |
| 443 | static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED) |
| 444 | { |
no test coverage detected