mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
gossip: Add gossip_store to the routing_state
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
e750d3cda1
commit
5c14f24bb3
5 changed files with 9 additions and 0 deletions
|
@ -93,6 +93,7 @@ struct routing_state *new_routing_state(const tal_t *ctx,
|
||||||
rstate->chain_hash = *chain_hash;
|
rstate->chain_hash = *chain_hash;
|
||||||
rstate->local_id = *local_id;
|
rstate->local_id = *local_id;
|
||||||
rstate->prune_timeout = prune_timeout;
|
rstate->prune_timeout = prune_timeout;
|
||||||
|
rstate->store = gossip_store_new(rstate);
|
||||||
list_head_init(&rstate->pending_cannouncement);
|
list_head_init(&rstate->pending_cannouncement);
|
||||||
uintmap_init(&rstate->chanmap);
|
uintmap_init(&rstate->chanmap);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <ccan/htable/htable_type.h>
|
#include <ccan/htable/htable_type.h>
|
||||||
#include <ccan/time/time.h>
|
#include <ccan/time/time.h>
|
||||||
#include <gossipd/broadcast.h>
|
#include <gossipd/broadcast.h>
|
||||||
|
#include <gossipd/gossip_store.h>
|
||||||
#include <wire/gen_onion_wire.h>
|
#include <wire/gen_onion_wire.h>
|
||||||
#include <wire/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? */
|
/* How old does a channel have to be before we prune it? */
|
||||||
u32 prune_timeout;
|
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 */
|
/* A map of channels indexed by short_channel_ids */
|
||||||
UINTMAP(struct chan *) chanmap;
|
UINTMAP(struct chan *) chanmap;
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,6 +47,7 @@ static int fake_pubkey_cmp(const struct pubkey *a, const struct pubkey *b)
|
||||||
#define pubkey_cmp fake_pubkey_cmp
|
#define pubkey_cmp fake_pubkey_cmp
|
||||||
#define type_to_string_ fake_type_to_string_
|
#define type_to_string_ fake_type_to_string_
|
||||||
#include "../routing.c"
|
#include "../routing.c"
|
||||||
|
#include "../gossip_store.c"
|
||||||
#undef type_to_string_
|
#undef type_to_string_
|
||||||
|
|
||||||
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
do { printf((fmt) ,##__VA_ARGS__); printf("\n"); } while(0)
|
do { printf((fmt) ,##__VA_ARGS__); printf("\n"); } while(0)
|
||||||
|
|
||||||
#include "../routing.c"
|
#include "../routing.c"
|
||||||
|
#include "../gossip_store.c"
|
||||||
|
|
||||||
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "../routing.c"
|
#include "../routing.c"
|
||||||
|
#include "../gossip_store.c"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED)
|
||||||
|
|
Loading…
Add table
Reference in a new issue