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

Function channel_msg

lightningd/channel_control.c:1590–1706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1588}
1589
1590static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds)
1591{
1592 enum channeld_wire t = fromwire_peektype(msg);
1593
1594 switch (t) {
1595 case WIRE_CHANNELD_SENDING_COMMITSIG:
1596 peer_sending_commitsig(sd->channel, msg);
1597 break;
1598 case WIRE_CHANNELD_LOCAL_ANCHOR_INFO:
1599 handle_local_anchors(sd->channel, msg);
1600 break;
1601 case WIRE_CHANNELD_GOT_COMMITSIG:
1602 peer_got_commitsig(sd->channel, msg);
1603 break;
1604 case WIRE_CHANNELD_GOT_REVOKE:
1605 peer_got_revoke(sd->channel, msg);
1606 break;
1607 case WIRE_CHANNELD_GOT_CHANNEL_READY:
1608 peer_got_channel_ready(sd->channel, msg);
1609 break;
1610 case WIRE_CHANNELD_GOT_ANNOUNCEMENT:
1611 peer_got_announcement(sd->channel, msg);
1612 break;
1613 case WIRE_CHANNELD_GOT_SHUTDOWN:
1614 peer_got_shutdown(sd->channel, msg);
1615 break;
1616 case WIRE_CHANNELD_REESTABLISHED:
1617 peer_channeld_reestablished(sd->channel, msg);
1618 break;
1619 case WIRE_CHANNELD_SHUTDOWN_COMPLETE:
1620 /* We expect 1 fd. */
1621 if (!fds)
1622 return 1;
1623 peer_start_closingd_after_shutdown(sd->channel, msg, fds);
1624 break;
1625 case WIRE_CHANNELD_FAIL_FALLEN_BEHIND:
1626 channel_fail_fallen_behind(sd->channel, msg);
1627 break;
1628 case WIRE_CHANNELD_SEND_ERROR_REPLY:
1629 handle_error_channel(sd->channel, msg);
1630 break;
1631 case WIRE_CHANNELD_SPLICE_CONFIRMED_INIT:
1632 handle_splice_confirmed_init(sd->ld, sd->channel, msg);
1633 break;
1634 case WIRE_CHANNELD_SPLICE_FEERATE_ERROR:
1635 handle_splice_feerate_error(sd->ld, sd->channel, msg);
1636 break;
1637 case WIRE_CHANNELD_SPLICE_FUNDING_ERROR:
1638 handle_splice_funding_error(sd->ld, sd->channel, msg);
1639 break;
1640 case WIRE_CHANNELD_SPLICE_ABORT:
1641 handle_splice_abort(sd->ld, sd->channel, msg);
1642 break;
1643 case WIRE_CHANNELD_SPLICE_STATE_ERROR:
1644 handle_splice_state_error(sd->ld, sd->channel, msg);
1645 break;
1646 case WIRE_CHANNELD_SPLICE_CONFIRMED_UPDATE:
1647 handle_splice_confirmed_update(sd->ld, sd->channel, msg);

Callers

nothing calls this directly

Calls 15

fromwire_peektypeFunction · 0.85
peer_sending_commitsigFunction · 0.85
handle_local_anchorsFunction · 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

Tested by

no test coverage detected