Browse Source

gossip: Add message types to store gossip msgs and associate data

Since we may want to extend the on-disk format by adding custom information we
may as well just go the extra mile and reuse the serialization primitives we
already have.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
0a5ea76d77
  1. 4
      gossipd/gossip.c
  2. 15
      gossipd/gossip_wire.csv
  3. 4
      lightningd/gossip_control.c

4
gossipd/gossip.c

@ -2080,6 +2080,10 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIP_GET_TXOUT: case WIRE_GOSSIP_GET_TXOUT:
case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLY: case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLY:
case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLYFAIL: case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLYFAIL:
/* gossip_store messages */
case WIRE_GOSSIP_STORE_CHANNEL_ANNOUNCEMENT:
case WIRE_GOSSIP_STORE_CHANNEL_UPDATE:
case WIRE_GOSSIP_STORE_NODE_ANNOUNCEMENT:
break; break;
} }

15
gossipd/gossip_wire.csv

@ -224,3 +224,18 @@ gossipctl_peer_disconnect_reply,3123
# Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer. # Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer.
gossipctl_peer_disconnect_replyfail,3223 gossipctl_peer_disconnect_replyfail,3223
gossipctl_peer_disconnect_replyfail,,isconnected,bool gossipctl_peer_disconnect_replyfail,,isconnected,bool
# gossip_store messages: messages persisted in the gossip_store
gossip_store_channel_announcement,4096
gossip_store_channel_announcement,,len,u16
gossip_store_channel_announcement,,announcement,len*u8
gossip_store_channel_announcement,,satoshis,u64
gossip_store_channel_update,4097
gossip_store_channel_update,,len,u16
gossip_store_channel_update,,update,len*u8
gossip_store_node_announcement,4098
gossip_store_node_announcement,,len,u16
gossip_store_node_announcement,,announcement,len*u8

Can't render this file because it has a wrong number of fields in line 6.

4
lightningd/gossip_control.c

@ -147,6 +147,10 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL: case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:
case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLY: case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLY:
case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLYFAIL: case WIRE_GOSSIPCTL_PEER_DISCONNECT_REPLYFAIL:
/* gossip_store messages */
case WIRE_GOSSIP_STORE_CHANNEL_ANNOUNCEMENT:
case WIRE_GOSSIP_STORE_CHANNEL_UPDATE:
case WIRE_GOSSIP_STORE_NODE_ANNOUNCEMENT:
break; break;
/* These are inter-daemon messages, not received by us */ /* These are inter-daemon messages, not received by us */
case WIRE_GOSSIP_LOCAL_ADD_CHANNEL: case WIRE_GOSSIP_LOCAL_ADD_CHANNEL:

Loading…
Cancel
Save