gossip: Add gossip_store to the routing_state

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-03-18 15:01:22 +01:00 committed by Rusty Russell
parent e750d3cda1
commit 5c14f24bb3
5 changed files with 9 additions and 0 deletions

View File

@ -93,6 +93,7 @@ struct routing_state *new_routing_state(const tal_t *ctx,
rstate->chain_hash = *chain_hash;
rstate->local_id = *local_id;
rstate->prune_timeout = prune_timeout;
rstate->store = gossip_store_new(rstate);
list_head_init(&rstate->pending_cannouncement);
uintmap_init(&rstate->chanmap);

View File

@ -6,6 +6,7 @@
#include <ccan/htable/htable_type.h>
#include <ccan/time/time.h>
#include <gossipd/broadcast.h>
#include <gossipd/gossip_store.h>
#include <wire/gen_onion_wire.h>
#include <wire/wire.h>
@ -157,6 +158,10 @@ struct routing_state {
/* How old does a channel have to be before we prune it? */
u32 prune_timeout;
/* Store for processed messages that we might want to remember across
* restarts */
struct gossip_store *store;
/* A map of channels indexed by short_channel_ids */
UINTMAP(struct chan *) chanmap;
};

View File

@ -47,6 +47,7 @@ static int fake_pubkey_cmp(const struct pubkey *a, const struct pubkey *b)
#define pubkey_cmp fake_pubkey_cmp
#define type_to_string_ fake_type_to_string_
#include "../routing.c"
#include "../gossip_store.c"
#undef type_to_string_
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)

View File

@ -12,6 +12,7 @@
do { printf((fmt) ,##__VA_ARGS__); printf("\n"); } while(0)
#include "../routing.c"
#include "../gossip_store.c"
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
{

View File

@ -1,4 +1,5 @@
#include "../routing.c"
#include "../gossip_store.c"
#include <stdio.h>
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)