forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gossip_store.h
42 lines (33 loc) · 1.09 KB
/
gossip_store.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LIGHTNING_GOSSIPD_GOSSIP_STORE_H
#define LIGHTNING_GOSSIPD_GOSSIP_STORE_H
#include "config.h"
#include <bitcoin/short_channel_id.h>
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
#include <gossipd/routing.h>
/**
* gossip_store -- On-disk storage related information
*/
#define GOSSIP_STORE_VERSION 2
struct gossip_store;
struct routing_state;
struct gossip_store *gossip_store_new(const tal_t *ctx,
struct routing_state *rstate,
struct broadcast_state *broadcast);
/**
* Load the initial gossip store, if any.
*
* @param rstate The routing state to load init.
* @param gs The `gossip_store` to read from
*/
void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs);
/**
* Add a gossip message to the gossip_store
*/
void gossip_store_add(struct gossip_store *gs, const u8 *gossip_msg);
/**
* Remember that we deleted a channel as a result of its outpoint being spent
*/
void gossip_store_add_channel_delete(struct gossip_store *gs,
const struct short_channel_id *scid);
#endif /* LIGHTNING_GOSSIPD_GOSSIP_STORE_H */