gossip: Added message for unsuccessful connection attempts

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-01-27 15:59:18 +01:00 committed by Rusty Russell
parent 6a9f40f7cc
commit f5147f27c9
3 changed files with 10 additions and 0 deletions

View File

@ -1913,6 +1913,7 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIP_RESOLVE_CHANNEL_REPLY:
case WIRE_GOSSIP_PEER_CONNECTED:
case WIRE_GOSSIP_PEER_ALREADY_CONNECTED:
case WIRE_GOSSIP_PEER_CONNECTION_FAILED:
case WIRE_GOSSIP_PEER_NONGOSSIP:
case WIRE_GOSSIP_GET_UPDATE:
case WIRE_GOSSIP_GET_UPDATE_REPLY:

View File

@ -43,6 +43,12 @@ gossip_peer_connected,,lfeatures,lflen*u8
gossip_peer_already_connected,3015
gossip_peer_already_connected,,id,struct pubkey
# gossipd -> master: attempted to connect, unsuccessful, gave up
gossip_peer_connection_failed,3020
gossip_peer_connection_failed,,id,struct pubkey
gossip_peer_connection_failed,,timeout,u32
gossip_peer_connection_failed,,attempts,u32
# Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip
gossip_peer_nongossip,3003
gossip_peer_nongossip,,id,struct pubkey

1 #include <common/cryptomsg.h>
43 gossip_peer_nongossip,,addr,struct wireaddr gossip_peer_connection_failed,,timeout,u32
44 gossip_peer_nongossip,,crypto_state,struct crypto_state gossip_peer_connection_failed,,attempts,u32
45 gossip_peer_nongossip,,gossip_index,u64 # Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip
46 gossip_peer_nongossip,3003
47 gossip_peer_nongossip,,id,struct pubkey
48 gossip_peer_nongossip,,addr,struct wireaddr
49 gossip_peer_nongossip,,crypto_state,struct crypto_state
50 gossip_peer_nongossip,,gossip_index,u64
51 gossip_peer_nongossip,,gflen,u16
52 gossip_peer_nongossip,,gflen,u16 gossip_peer_nongossip,,gfeatures,gflen*u8
53 gossip_peer_nongossip,,gfeatures,gflen*u8 gossip_peer_nongossip,,lflen,u16
54 gossip_peer_nongossip,,lflen,u16 gossip_peer_nongossip,,lfeatures,lflen*u8

View File

@ -133,6 +133,9 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
case WIRE_GOSSIP_PEER_ALREADY_CONNECTED:
peer_already_connected(gossip->ld, msg);
break;
case WIRE_GOSSIP_PEER_CONNECTION_FAILED:
/* TODO(cdecker) Implement handler */
break;
case WIRE_GOSSIP_PEER_NONGOSSIP:
if (tal_count(fds) != 2)
return 2;