| 509 | } |
| 510 | |
| 511 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 512 | { |
| 513 | struct htlc_stub htlc; |
| 514 | |
| 515 | if (!fromwire_onchaind_htlc_timeout(msg, &htlc)) { |
| 516 | channel_internal_error(channel, "Invalid onchain_htlc_timeout"); |
| 517 | return; |
| 518 | } |
| 519 | |
| 520 | /* It should tell us about timeouts on our LOCAL htlcs */ |
| 521 | if (htlc.owner != LOCAL) { |
| 522 | channel_internal_error(channel, |
| 523 | "onchaind_htlc_timeout: htlc %"PRIu64" is not local!", |
| 524 | htlc.id); |
| 525 | return; |
| 526 | } |
| 527 | |
| 528 | /* BOLT #5: |
| 529 | * |
| 530 | * - if the commitment transaction HTLC output has *timed out* and |
| 531 | * hasn't been *resolved*: |
| 532 | * - MUST *resolve* the output by spending it using the HTLC-timeout |
| 533 | * transaction. |
| 534 | */ |
| 535 | onchain_failed_our_htlc(channel, &htlc, "timed out", true); |
| 536 | } |
| 537 | |
| 538 | static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg UNUSED) |
| 539 | { |
no test coverage detected