mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-09 23:27:17 +01:00
f511012e29
The gossip subdaemon previously passed the fd after init: this is unnecessary for peers which simply want to gossip (and not establish channels). Now we hand the gossip fd back with the peer fd. This adds another error message for when we fail to create the gossip fds. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2.1 KiB
2.1 KiB
1 | # These are fatal. |
---|---|
2 | gossipstatus_init_failed,0x8000 |
3 | gossipstatus_bad_new_peer_request,0x8001 |
4 | gossipstatus_bad_release_request,0x8002 |
5 | gossipstatus_bad_request,0x8003 |
6 | gossipstatus_fdpass_failed,0x8004 |
7 | # Peers can give a bad message, we close their fd, but no harm done. |
8 | gossipstatus_peer_bad_msg,1000 |
9 | gossipstatus_peer_bad_msg,0,unique_id,8 |
10 | gossipstatus_peer_bad_msg,8,len,2 |
11 | gossipstatus_peer_bad_msg,10,err,len*u8 |
12 | # Misc problems like opening control fd. |
13 | gossipstatus_peer_failed,1001 |
14 | gossipstatus_peer_failed,0,unique_id,8 |
15 | gossipstatus_peer_failed,8,len,2 |
16 | gossipstatus_peer_failed,10,err,len*u8 |
17 | #include <lightningd/cryptomsg.h> |
18 | # These take an fd, but have no response |
19 | # (if it is to move onto a channel, we get a status msg). |
20 | gossipctl_new_peer,1 |
21 | gossipctl_new_peer,0,unique_id,8 |
22 | gossipctl_new_peer,8,crypto_state,struct crypto_state |
23 | # Tell it to release a peer which has initialized. |
24 | gossipctl_release_peer,2 |
25 | gossipctl_release_peer,0,unique_id,8 |
26 | # This releases the peer and returns the cryptostate (followed two fds: peer and gossip) |
27 | gossipctl_release_peer_reply,102 |
28 | gossipctl_release_peer_reply,0,unique_id,8 |
29 | gossipctl_release_peer_reply,8,crypto_state,struct crypto_state |
30 | # This is where we save a peer's features. |
31 | #gossipstatus_peer_features,1 |
32 | #gossipstatus_peer_features,0,unique_id,8 |
33 | #gossipstatus_peer_features,8,gflen,2 |
34 | #gossipstatus_peer_features,10,globalfeatures,gflen |
35 | #gossipstatus_peer_features,10+gflen,lflen,2 |
36 | #gossipstatus_peer_features,12+gflen,localfeatures,lflen |
37 | # Peer init handshake complete (now you can release_peer if you want) |
38 | gossipstatus_peer_ready,3 |
39 | gossipstatus_peer_ready,0,unique_id,8 |
40 | # Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip) |
41 | gossipstatus_peer_nongossip,4 |
42 | gossipstatus_peer_nongossip,0,unique_id,8 |
43 | gossipstatus_peer_nongossip,10,crypto_state,struct crypto_state |
44 | gossipstatus_peer_nongossip,154,len,2 |
45 | gossipstatus_peer_nongossip,156,msg,len*u8 |
46 | # Pass JSON-RPC getnodes call through |
47 | gossip_getnodes_request,5 |
48 | #include <lightningd/gossip_msg.h> |
49 | gossip_getnodes_reply,105 |
50 | gossip_getnodes_reply,0,num_nodes,u16 |
51 | gossip_getnodes_reply,2,nodes,num_nodes*struct gossip_getnodes_entry |