| 384 | } |
| 385 | |
| 386 | static void handle_missing_htlc_output(struct channel *channel, const u8 *msg) |
| 387 | { |
| 388 | struct htlc_stub htlc; |
| 389 | |
| 390 | if (!fromwire_onchaind_missing_htlc_output(msg, &htlc)) { |
| 391 | channel_internal_error(channel, "Invalid missing_htlc_output"); |
| 392 | return; |
| 393 | } |
| 394 | |
| 395 | /* We only set tell_if_missing on LOCAL htlcs */ |
| 396 | if (htlc.owner != LOCAL) { |
| 397 | channel_internal_error(channel, |
| 398 | "onchaind_missing_htlc_output: htlc %"PRIu64" is not local!", |
| 399 | htlc.id); |
| 400 | return; |
| 401 | } |
| 402 | |
| 403 | /* BOLT #5: |
| 404 | * |
| 405 | * - for any committed HTLC that does NOT have an output in this |
| 406 | * commitment transaction: |
| 407 | * - once the commitment transaction has reached reasonable depth: |
| 408 | * - MUST fail the corresponding incoming HTLC (if any). |
| 409 | * - if no *valid* commitment transaction contains an output |
| 410 | * corresponding to the HTLC. |
| 411 | * - MAY fail the corresponding incoming HTLC sooner. |
| 412 | */ |
| 413 | onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false); |
| 414 | } |
| 415 | |
| 416 | static void handle_onchain_htlc_timeout(struct channel *channel, const u8 *msg) |
| 417 | { |
no test coverage detected