gossip: Track whether we read a message from store or peer

When we read from the gossip_store we set store=false so that we don't duplicate
messages in the store.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-03-20 16:55:52 +01:00
committed by Rusty Russell
parent 2879d78f22
commit a571bf9d3a
3 changed files with 42 additions and 28 deletions

View File

@@ -200,7 +200,8 @@ struct chan *new_chan(struct routing_state *rstate,
*/
u8 *handle_channel_announcement(struct routing_state *rstate,
const u8 *announce TAKES,
const struct short_channel_id **scid);
const struct short_channel_id **scid,
bool store);
/**
* handle_pending_cannouncement -- handle channel_announce once we've
@@ -216,10 +217,12 @@ bool handle_pending_cannouncement(struct routing_state *rstate,
const u8 *txscript);
/* Returns NULL if all OK, otherwise an error for the peer which sent. */
u8 *handle_channel_update(struct routing_state *rstate, const u8 *update);
u8 *handle_channel_update(struct routing_state *rstate, const u8 *update,
bool store);
/* Returns NULL if all OK, otherwise an error for the peer which sent. */
u8 *handle_node_announcement(struct routing_state *rstate, const u8 *node);
u8 *handle_node_announcement(struct routing_state *rstate, const u8 *node,
bool store);
/* Set values on the struct node_connection */
void set_connection_values(struct chan *chan,