mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
2209d0149f
We stop listening, and also refuse to send "connectd_peer_spoke" to create new subdaemons. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5.8 KiB
5.8 KiB
1 | #include <bitcoin/block.h> |
---|---|
2 | #include <common/channel_id.h> |
3 | #include <common/cryptomsg.h> |
4 | #include <common/features.h> |
5 | #include <common/node_id.h> |
6 | #include <common/wireaddr.h> |
7 | #include <wire/onion_wire.h> |
8 | msgtype,connectd_init,2000 |
9 | msgdata,connectd_init,chainparams,chainparams, |
10 | msgdata,connectd_init,our_features,feature_set, |
11 | msgdata,connectd_init,id,node_id, |
12 | msgdata,connectd_init,num_wireaddrs,u16, |
13 | msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs |
14 | msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs |
15 | msgdata,connectd_init,tor_proxyaddr,?wireaddr, |
16 | msgdata,connectd_init,use_tor_proxy_always,bool, |
17 | msgdata,connectd_init,dev_allow_localhost,bool, |
18 | msgdata,connectd_init,use_dns,bool, |
19 | msgdata,connectd_init,tor_password,wirestring, |
20 | msgdata,connectd_init,timeout_secs,u32, |
21 | msgdata,connectd_init,websocket_helper,wirestring, |
22 | msgdata,connectd_init,websocket_port,u16, |
23 | msgdata,connectd_init,announce_websocket,bool, |
24 | msgdata,connectd_init,dev_fast_gossip,bool, |
25 | # If this is set, then fd 5 is dev_disconnect_fd. |
26 | msgdata,connectd_init,dev_disconnect,bool, |
27 | msgdata,connectd_init,dev_no_ping_timer,bool, |
28 | # Connectd->master, here are the addresses I bound, can announce. |
29 | msgtype,connectd_init_reply,2100 |
30 | msgdata,connectd_init_reply,num_bindings,u16, |
31 | msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings |
32 | msgdata,connectd_init_reply,num_announceable,u16, |
33 | msgdata,connectd_init_reply,announceable,wireaddr,num_announceable |
34 | msgdata,connectd_init_reply,failmsg,?wirestring, |
35 | # Activate the connect daemon, so others can connect. |
36 | msgtype,connectd_activate,2025 |
37 | # Do we listen? |
38 | msgdata,connectd_activate,listen,bool, |
39 | # Connectd->master, I am ready. |
40 | msgtype,connectd_activate_reply,2125 |
41 | msgdata,connectd_activate_reply,failmsg,?wirestring, |
42 | # Master -> connectd: connect to a peer. |
43 | msgtype,connectd_connect_to_peer,2001 |
44 | msgdata,connectd_connect_to_peer,id,node_id, |
45 | msgdata,connectd_connect_to_peer,len,u32, |
46 | msgdata,connectd_connect_to_peer,addrs,wireaddr,len |
47 | msgdata,connectd_connect_to_peer,addrhint,?wireaddr_internal, |
48 | msgdata,connectd_connect_to_peer,dns_fallback,bool, |
49 | # Connectd->master: connect failed. |
50 | msgtype,connectd_connect_failed,2020 |
51 | msgdata,connectd_connect_failed,id,node_id, |
52 | msgdata,connectd_connect_failed,failcode,enum jsonrpc_errcode, |
53 | msgdata,connectd_connect_failed,failreason,wirestring, |
54 | msgdata,connectd_connect_failed,addrhint,?wireaddr_internal, |
55 | # Connectd -> master: we got a peer. |
56 | msgtype,connectd_peer_connected,2002 |
57 | msgdata,connectd_peer_connected,id,node_id, |
58 | msgdata,connectd_peer_connected,counter,u64, |
59 | msgdata,connectd_peer_connected,addr,wireaddr_internal, |
60 | msgdata,connectd_peer_connected,remote_addr,?wireaddr, |
61 | msgdata,connectd_peer_connected,incoming,bool, |
62 | msgdata,connectd_peer_connected,flen,u16, |
63 | msgdata,connectd_peer_connected,features,u8,flen |
64 | # connectd -> master: peer disconnected. |
65 | msgtype,connectd_peer_disconnect_done,2006 |
66 | msgdata,connectd_peer_disconnect_done,id,node_id, |
67 | msgdata,connectd_peer_disconnect_done,counter,u64, |
68 | # Master -> connectd: make peer active immediately (we want to talk) (+ fd to subd). |
69 | msgtype,connectd_peer_connect_subd,2004 |
70 | msgdata,connectd_peer_connect_subd,id,node_id, |
71 | msgdata,connectd_peer_connect_subd,counter,u64, |
72 | msgdata,connectd_peer_connect_subd,channel_id,channel_id, |
73 | # Connectd -> master: peer said something interesting |
74 | msgtype,connectd_peer_spoke,2005 |
75 | msgdata,connectd_peer_spoke,id,node_id, |
76 | msgdata,connectd_peer_spoke,counter,u64, |
77 | msgdata,connectd_peer_spoke,msgtype,u16, |
78 | msgdata,connectd_peer_spoke,channel_id,channel_id, |
79 | # master -> connectd: peer no longer wanted, you can disconnect. |
80 | msgtype,connectd_discard_peer,2015 |
81 | msgdata,connectd_discard_peer,id,node_id, |
82 | msgdata,connectd_discard_peer,counter,u64, |
83 | # master -> connectd: give message to peer and disconnect. |
84 | msgtype,connectd_peer_final_msg,2003 |
85 | msgdata,connectd_peer_final_msg,id,node_id, |
86 | msgdata,connectd_peer_final_msg,counter,u64, |
87 | msgdata,connectd_peer_final_msg,len,u16, |
88 | msgdata,connectd_peer_final_msg,msg,u8,len |
89 | # master -> connectd: do you have a memleak? |
90 | msgtype,connectd_dev_memleak,2033 |
91 | msgtype,connectd_dev_memleak_reply,2133 |
92 | msgdata,connectd_dev_memleak_reply,leak,bool, |
93 | # Ping/pong test. Waits for a reply if it expects one. |
94 | msgtype,connectd_ping,2030 |
95 | msgdata,connectd_ping,id,node_id, |
96 | msgdata,connectd_ping,num_pong_bytes,u16, |
97 | msgdata,connectd_ping,len,u16, |
98 | msgtype,connectd_ping_reply,2130 |
99 | # False if we there was already a ping in progress. |
100 | msgdata,connectd_ping_reply,sent,bool, |
101 | # 0 == no pong expected, otherwise length of pong. |
102 | msgdata,connectd_ping_reply,totlen,u16, |
103 | # We tell lightningd we got an onionmsg |
104 | msgtype,connectd_got_onionmsg_to_us,2145 |
105 | msgdata,connectd_got_onionmsg_to_us,path_secret,?secret, |
106 | msgdata,connectd_got_onionmsg_to_us,reply,?blinded_path, |
107 | msgdata,connectd_got_onionmsg_to_us,rawmsg_len,u16, |
108 | msgdata,connectd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len |
109 | # Lightningd tells us to send an onion message. |
110 | msgtype,connectd_send_onionmsg,2041 |
111 | msgdata,connectd_send_onionmsg,id,node_id, |
112 | msgdata,connectd_send_onionmsg,onion_len,u16, |
113 | msgdata,connectd_send_onionmsg,onion,u8,onion_len |
114 | msgdata,connectd_send_onionmsg,blinding,pubkey, |
115 | # A custom message that we got from a peer and don't know how to handle, so we |
116 | # forward it to the master for further handling. |
117 | msgtype,connectd_custommsg_in,2110 |
118 | msgdata,connectd_custommsg_in,id,node_id, |
119 | msgdata,connectd_custommsg_in,msg_len,u16, |
120 | msgdata,connectd_custommsg_in,msg,u8,msg_len |
121 | # A custom message that the lightningd tells us to send to the peer. |
122 | msgtype,connectd_custommsg_out,2011 |
123 | msgdata,connectd_custommsg_out,id,node_id, |
124 | msgdata,connectd_custommsg_out,msg_len,u16, |
125 | msgdata,connectd_custommsg_out,msg,u8,msg_len |
126 | # master -> connectd: we're shutting down, no new connections. |
127 | msgtype,connectd_start_shutdown,2031 |
128 | # connect - >master: acknowledged. |
129 | msgtype,connectd_start_shutdown_reply,2131 |
130 | # master -> connect: stop sending gossip. |
131 | msgtype,connectd_dev_suppress_gossip,2032 |