| 521 | #endif /* EXPERIMENTAL_FEATURES */ |
| 522 | |
| 523 | static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds) |
| 524 | { |
| 525 | enum channeld_wire t = fromwire_peektype(msg); |
| 526 | |
| 527 | switch (t) { |
| 528 | case WIRE_CHANNELD_SENDING_COMMITSIG: |
| 529 | peer_sending_commitsig(sd->channel, msg); |
| 530 | break; |
| 531 | case WIRE_CHANNELD_GOT_COMMITSIG: |
| 532 | peer_got_commitsig(sd->channel, msg); |
| 533 | break; |
| 534 | case WIRE_CHANNELD_GOT_REVOKE: |
| 535 | peer_got_revoke(sd->channel, msg); |
| 536 | break; |
| 537 | case WIRE_CHANNELD_GOT_CHANNEL_READY: |
| 538 | peer_got_channel_ready(sd->channel, msg); |
| 539 | break; |
| 540 | case WIRE_CHANNELD_GOT_ANNOUNCEMENT: |
| 541 | peer_got_announcement(sd->channel, msg); |
| 542 | break; |
| 543 | case WIRE_CHANNELD_GOT_SHUTDOWN: |
| 544 | peer_got_shutdown(sd->channel, msg); |
| 545 | break; |
| 546 | case WIRE_CHANNELD_SHUTDOWN_COMPLETE: |
| 547 | /* We expect 1 fd. */ |
| 548 | if (!fds) |
| 549 | return 1; |
| 550 | peer_start_closingd_after_shutdown(sd->channel, msg, fds); |
| 551 | break; |
| 552 | case WIRE_CHANNELD_FAIL_FALLEN_BEHIND: |
| 553 | channel_fail_fallen_behind(sd->channel, msg); |
| 554 | break; |
| 555 | case WIRE_CHANNELD_SEND_ERROR_REPLY: |
| 556 | handle_error_channel(sd->channel, msg); |
| 557 | break; |
| 558 | case WIRE_CHANNELD_USED_CHANNEL_UPDATE: |
| 559 | /* This tells gossipd we used it. */ |
| 560 | get_channel_update(sd->channel); |
| 561 | break; |
| 562 | case WIRE_CHANNELD_LOCAL_CHANNEL_UPDATE: |
| 563 | tell_gossipd_local_channel_update(sd->ld, sd->channel, msg); |
| 564 | break; |
| 565 | case WIRE_CHANNELD_LOCAL_CHANNEL_ANNOUNCEMENT: |
| 566 | tell_gossipd_local_channel_announce(sd->ld, sd->channel, msg); |
| 567 | break; |
| 568 | case WIRE_CHANNELD_LOCAL_PRIVATE_CHANNEL: |
| 569 | handle_local_private_channel(sd->channel, msg); |
| 570 | break; |
| 571 | #if EXPERIMENTAL_FEATURES |
| 572 | case WIRE_CHANNELD_UPGRADED: |
| 573 | handle_channel_upgrade(sd->channel, msg); |
| 574 | break; |
| 575 | #else |
| 576 | case WIRE_CHANNELD_UPGRADED: |
| 577 | #endif |
| 578 | /* And we never get these from channeld. */ |
| 579 | case WIRE_CHANNELD_INIT: |
| 580 | case WIRE_CHANNELD_FUNDING_DEPTH: |
nothing calls this directly
no test coverage detected