forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgossip_rcvd_filter.h
More file actions
22 lines (16 loc) · 819 Bytes
/
Copy pathgossip_rcvd_filter.h
File metadata and controls
22 lines (16 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* This implements a cheap gossip cache, so we can recognize what gossip
* msgs this peer sent us, thus avoid retransmitting gossip it sent. */
#ifndef LIGHTNING_COMMON_GOSSIP_RCVD_FILTER_H
#define LIGHTNING_COMMON_GOSSIP_RCVD_FILTER_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
struct gossip_rcvd_filter;
struct gossip_rcvd_filter *new_gossip_rcvd_filter(const tal_t *ctx);
/* Add a gossip msg to the received map */
void gossip_rcvd_filter_add(struct gossip_rcvd_filter *map, const u8 *msg);
/* Is a gossip msg in the received map? (Removes it) */
bool gossip_rcvd_filter_del(struct gossip_rcvd_filter *map, const u8 *msg);
/* Flush out old entries. */
void gossip_rcvd_filter_age(struct gossip_rcvd_filter *map);
#endif /* LIGHTNING_COMMON_GOSSIP_RCVD_FILTER_H */