Browse Source

gossip: Add gossip_store to the routing_state

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
5c14f24bb3
  1. 1
      gossipd/routing.c
  2. 5
      gossipd/routing.h
  3. 1
      gossipd/test/run-bench-find_route.c
  4. 1
      gossipd/test/run-find_route-specific.c
  5. 1
      gossipd/test/run-find_route.c

1
gossipd/routing.c

@ -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);

5
gossipd/routing.h

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

1
gossipd/test/run-bench-find_route.c

@ -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)

1
gossipd/test/run-find_route-specific.c

@ -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)
{

1
gossipd/test/run-find_route.c

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

Loading…
Cancel
Save