mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
16e9ba0361
The message from lightningd simply acknowleges that we are allowed to discard the peer (because no subdaemons are talking to it anymore). This difference becomes more stark once connectd holds on to idle peers. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5.2 KiB
5.2 KiB
1 | #include <bitcoin/block.h> |
---|---|
2 | #include <common/cryptomsg.h> |
3 | #include <common/features.h> |
4 | #include <common/node_id.h> |
5 | #include <common/wireaddr.h> |
6 | #include <wire/onion_wire.h> |
7 | msgtype,connectd_init,2000 |
8 | msgdata,connectd_init,chainparams,chainparams, |
9 | msgdata,connectd_init,our_features,feature_set, |
10 | msgdata,connectd_init,id,node_id, |
11 | msgdata,connectd_init,num_wireaddrs,u16, |
12 | msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs |
13 | msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs |
14 | msgdata,connectd_init,tor_proxyaddr,?wireaddr, |
15 | msgdata,connectd_init,use_tor_proxy_always,bool, |
16 | msgdata,connectd_init,dev_allow_localhost,bool, |
17 | msgdata,connectd_init,use_dns,bool, |
18 | msgdata,connectd_init,tor_password,wirestring, |
19 | msgdata,connectd_init,use_v3_autotor,bool, |
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,dev_fast_gossip,bool, |
24 | # If this is set, then fd 5 is dev_disconnect_fd. |
25 | msgdata,connectd_init,dev_disconnect,bool, |
26 | # Connectd->master, here are the addresses I bound, can announce. |
27 | msgtype,connectd_init_reply,2100 |
28 | msgdata,connectd_init_reply,num_bindings,u16, |
29 | msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings |
30 | msgdata,connectd_init_reply,num_announceable,u16, |
31 | msgdata,connectd_init_reply,announceable,wireaddr,num_announceable |
32 | msgdata,connectd_init_reply,failmsg,?wirestring, |
33 | # Activate the connect daemon, so others can connect. |
34 | msgtype,connectd_activate,2025 |
35 | # Do we listen? |
36 | msgdata,connectd_activate,listen,bool, |
37 | # Connectd->master, I am ready. |
38 | msgtype,connectd_activate_reply,2125 |
39 | msgdata,connectd_activate_reply,failmsg,?wirestring, |
40 | # connectd->master: disconnect this peer please (due to reconnect). |
41 | msgtype,connectd_reconnected,2112 |
42 | msgdata,connectd_reconnected,id,node_id, |
43 | # Master -> connectd: connect to a peer. |
44 | msgtype,connectd_connect_to_peer,2001 |
45 | msgdata,connectd_connect_to_peer,id,node_id, |
46 | msgdata,connectd_connect_to_peer,seconds_waited,u32, |
47 | msgdata,connectd_connect_to_peer,len,u32, |
48 | msgdata,connectd_connect_to_peer,addrs,wireaddr,len |
49 | msgdata,connectd_connect_to_peer,addrhint,?wireaddr_internal, |
50 | # Connectd->master: connect failed. |
51 | msgtype,connectd_connect_failed,2020 |
52 | msgdata,connectd_connect_failed,id,node_id, |
53 | msgdata,connectd_connect_failed,failcode,errcode_t, |
54 | msgdata,connectd_connect_failed,failreason,wirestring, |
55 | msgdata,connectd_connect_failed,seconds_to_delay,u32, |
56 | msgdata,connectd_connect_failed,addrhint,?wireaddr_internal, |
57 | # Connectd -> master: we got a peer. Plus fd for peer daemon |
58 | msgtype,connectd_peer_connected,2002 |
59 | msgdata,connectd_peer_connected,id,node_id, |
60 | msgdata,connectd_peer_connected,addr,wireaddr_internal, |
61 | msgdata,connectd_peer_connected,remote_addr,?wireaddr, |
62 | msgdata,connectd_peer_connected,incoming,bool, |
63 | msgdata,connectd_peer_connected,flen,u16, |
64 | msgdata,connectd_peer_connected,features,u8,flen |
65 | # master -> connectd: peer no longer wanted, you can disconnect. |
66 | msgtype,connectd_discard_peer,2015 |
67 | msgdata,connectd_discard_peer,id,node_id, |
68 | # master -> connectd: give message to peer and disconnect. |
69 | msgtype,connectd_peer_final_msg,2003 |
70 | msgdata,connectd_peer_final_msg,id,node_id, |
71 | msgdata,connectd_peer_final_msg,len,u16, |
72 | msgdata,connectd_peer_final_msg,msg,u8,len |
73 | # master -> connectd: do you have a memleak? |
74 | msgtype,connectd_dev_memleak,2033 |
75 | msgtype,connectd_dev_memleak_reply,2133 |
76 | msgdata,connectd_dev_memleak_reply,leak,bool, |
77 | # Ping/pong test. Waits for a reply if it expects one. |
78 | msgtype,connectd_ping,2030 |
79 | msgdata,connectd_ping,id,node_id, |
80 | msgdata,connectd_ping,num_pong_bytes,u16, |
81 | msgdata,connectd_ping,len,u16, |
82 | msgtype,connectd_ping_reply,2130 |
83 | # False if we there was already a ping in progress. |
84 | msgdata,connectd_ping_reply,sent,bool, |
85 | # 0 == no pong expected, otherwise length of pong. |
86 | msgdata,connectd_ping_reply,totlen,u16, |
87 | # We tell lightningd we got an onionmsg |
88 | msgtype,connectd_got_onionmsg_to_us,2145 |
89 | msgdata,connectd_got_onionmsg_to_us,obs2,bool, |
90 | msgdata,connectd_got_onionmsg_to_us,node_alias,pubkey, |
91 | msgdata,connectd_got_onionmsg_to_us,self_id,?secret, |
92 | msgdata,connectd_got_onionmsg_to_us,reply_blinding,?pubkey, |
93 | msgdata,connectd_got_onionmsg_to_us,reply_first_node,?pubkey, |
94 | msgdata,connectd_got_onionmsg_to_us,reply_path_len,u16, |
95 | msgdata,connectd_got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len |
96 | msgdata,connectd_got_onionmsg_to_us,rawmsg_len,u16, |
97 | msgdata,connectd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len |
98 | # Lightningd tells us to send an onion message. |
99 | msgtype,connectd_send_onionmsg,2041 |
100 | msgdata,connectd_send_onionmsg,obs2,bool, |
101 | msgdata,connectd_send_onionmsg,id,node_id, |
102 | msgdata,connectd_send_onionmsg,onion_len,u16, |
103 | msgdata,connectd_send_onionmsg,onion,u8,onion_len |
104 | msgdata,connectd_send_onionmsg,blinding,pubkey, |
105 | # A custom message that we got from a peer and don't know how to handle, so we |
106 | # forward it to the master for further handling. |
107 | msgtype,connectd_custommsg_in,2110 |
108 | msgdata,connectd_custommsg_in,id,node_id, |
109 | msgdata,connectd_custommsg_in,msg_len,u16, |
110 | msgdata,connectd_custommsg_in,msg,u8,msg_len |
111 | # A custom message that the lightningd tells us to send to the peer. |
112 | msgtype,connectd_custommsg_out,2011 |
113 | msgdata,connectd_custommsg_out,id,node_id, |
114 | msgdata,connectd_custommsg_out,msg_len,u16, |
115 | msgdata,connectd_custommsg_out,msg,u8,msg_len |