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>
This commit is contained in:
Christian Decker 2018-03-23 15:39:16 +01:00 committed by Rusty Russell
parent 1b6db5fd52
commit 0a5ea76d77
3 changed files with 23 additions and 0 deletions

View File

@ -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_GOSSIPCTL_PEER_DISCONNECT_REPLY:
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;
}

View File

@ -224,3 +224,18 @@ gossipctl_peer_disconnect_reply,3123
# Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer.
gossipctl_peer_disconnect_replyfail,3223
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

1 #include <common/cryptomsg.h>
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241

View File

@ -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_PEER_DISCONNECT_REPLY:
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;
/* These are inter-daemon messages, not received by us */
case WIRE_GOSSIP_LOCAL_ADD_CHANNEL: