mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
common/gossip_store: add flag to *only* fetch "push"-marked messages.
These are the ones which are for our own channels (and our own node_announcement). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ee21ae814a
commit
9b944dbed4
@ -53,6 +53,7 @@ static size_t reopen_gossip_store(int *gossip_store_fd, const u8 *msg)
|
||||
u8 *gossip_store_next(const tal_t *ctx,
|
||||
int *gossip_store_fd,
|
||||
u32 timestamp_min, u32 timestamp_max,
|
||||
bool push_only,
|
||||
size_t *off, size_t *end)
|
||||
{
|
||||
u8 *msg = NULL;
|
||||
@ -109,6 +110,8 @@ u8 *gossip_store_next(const tal_t *ctx,
|
||||
!timestamp_filter(timestamp_min, timestamp_max,
|
||||
timestamp)) {
|
||||
msg = tal_free(msg);
|
||||
} else if (!push && push_only) {
|
||||
msg = tal_free(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@ struct gossip_hdr {
|
||||
u8 *gossip_store_next(const tal_t *ctx,
|
||||
int *gossip_store_fd,
|
||||
u32 timestamp_min, u32 timestamp_max,
|
||||
bool push_only,
|
||||
size_t *off, size_t *end);
|
||||
|
||||
/**
|
||||
|
@ -367,6 +367,7 @@ again:
|
||||
msg = gossip_store_next(ctx, &peer->daemon->gossip_store_fd,
|
||||
peer->gs.timestamp_min,
|
||||
peer->gs.timestamp_max,
|
||||
false,
|
||||
&peer->gs.off,
|
||||
&peer->daemon->gossip_store_end);
|
||||
/* Don't send back gossip they sent to us! */
|
||||
|
Loading…
Reference in New Issue
Block a user