MCPcopy Create free account
hub / github.com/ElementsProject/lightning / channel_msg

Function channel_msg

lightningd/channel_control.c:523–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521#endif /* EXPERIMENTAL_FEATURES */
522
523static 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:

Callers

nothing calls this directly

Calls 15

peer_sending_commitsigFunction · 0.85
peer_got_commitsigFunction · 0.85
peer_got_revokeFunction · 0.85
peer_got_channel_readyFunction · 0.85
peer_got_announcementFunction · 0.85
peer_got_shutdownFunction · 0.85
handle_error_channelFunction · 0.85
handle_channel_upgradeFunction · 0.85

Tested by

no test coverage detected