~ This routine handles all the commands from lightningd. */
| 982 | |
| 983 | /*~ This routine handles all the commands from lightningd. */ |
| 984 | static struct io_plan *recv_req(struct io_conn *conn, |
| 985 | const u8 *msg, |
| 986 | struct daemon *daemon) |
| 987 | { |
| 988 | enum gossipd_wire t = fromwire_peektype(msg); |
| 989 | |
| 990 | switch (t) { |
| 991 | case WIRE_GOSSIPD_INIT: |
| 992 | gossip_init(daemon, msg); |
| 993 | goto done; |
| 994 | |
| 995 | case WIRE_GOSSIPD_GET_TXOUT_REPLY: |
| 996 | handle_txout_reply(daemon, msg); |
| 997 | goto done; |
| 998 | |
| 999 | case WIRE_GOSSIPD_OUTPOINTS_SPENT: |
| 1000 | handle_outpoints_spent(daemon, msg); |
| 1001 | goto done; |
| 1002 | |
| 1003 | case WIRE_GOSSIPD_LOCAL_CHANNEL_CLOSE: |
| 1004 | handle_local_channel_close(daemon, msg); |
| 1005 | goto done; |
| 1006 | |
| 1007 | case WIRE_GOSSIPD_NEW_BLOCKHEIGHT: |
| 1008 | new_blockheight(daemon, msg); |
| 1009 | goto done; |
| 1010 | |
| 1011 | case WIRE_GOSSIPD_ADDGOSSIP: |
| 1012 | inject_gossip(daemon, msg); |
| 1013 | goto done; |
| 1014 | |
| 1015 | case WIRE_GOSSIPD_NEW_LEASE_RATES: |
| 1016 | handle_new_lease_rates(daemon, msg); |
| 1017 | goto done; |
| 1018 | |
| 1019 | case WIRE_GOSSIPD_GET_ADDRS: |
| 1020 | return handle_get_address(conn, daemon, msg); |
| 1021 | |
| 1022 | case WIRE_GOSSIPD_USED_LOCAL_CHANNEL_UPDATE: |
| 1023 | handle_used_local_channel_update(daemon, msg); |
| 1024 | goto done; |
| 1025 | |
| 1026 | case WIRE_GOSSIPD_LOCAL_CHANNEL_UPDATE: |
| 1027 | handle_local_channel_update(daemon, msg); |
| 1028 | goto done; |
| 1029 | |
| 1030 | case WIRE_GOSSIPD_LOCAL_CHANNEL_ANNOUNCEMENT: |
| 1031 | handle_local_channel_announcement(daemon, msg); |
| 1032 | goto done; |
| 1033 | |
| 1034 | case WIRE_GOSSIPD_LOCAL_PRIVATE_CHANNEL: |
| 1035 | handle_local_private_channel(daemon, msg); |
| 1036 | goto done; |
| 1037 | |
| 1038 | case WIRE_GOSSIPD_DISCOVERED_IP: |
| 1039 | handle_discovered_ip(daemon, msg); |
| 1040 | goto done; |
| 1041 | #if DEVELOPER |
nothing calls this directly
no test coverage detected