mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-28 17:44:47 +01:00
6115ed02e8
We now let gossipd do it. This also means there's nothing left in 'struct per_peer_state' to send across the wire (the fds are sent separately), so that gets removed from wire messages too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
36 lines
1.0 KiB
C
36 lines
1.0 KiB
C
#ifndef LIGHTNING_COMMON_PER_PEER_STATE_H
|
|
#define LIGHTNING_COMMON_PER_PEER_STATE_H
|
|
#include "config.h"
|
|
|
|
#include <ccan/tal/tal.h>
|
|
#include <ccan/time/time.h>
|
|
#include <common/crypto_state.h>
|
|
|
|
struct gossip_state {
|
|
/* Time for next gossip burst. */
|
|
struct timemono next_gossip;
|
|
/* Timestamp filtering for gossip. */
|
|
u32 timestamp_min, timestamp_max;
|
|
};
|
|
|
|
/* Things we hand between daemons to talk to peers. */
|
|
struct per_peer_state {
|
|
/* If not -1, closed on freeing */
|
|
int peer_fd, gossip_fd;
|
|
};
|
|
|
|
/* Allocate a new per-peer state and add destructor to close fds if set;
|
|
* sets fds to -1. */
|
|
struct per_peer_state *new_per_peer_state(const tal_t *ctx);
|
|
|
|
/* Initialize the fds (must be -1 previous) */
|
|
void per_peer_state_set_fds(struct per_peer_state *pps,
|
|
int peer_fd, int gossip_fd);
|
|
|
|
/* Array version of above: tal_count(fds) must be 2 */
|
|
void per_peer_state_set_fds_arr(struct per_peer_state *pps, const int *fds);
|
|
|
|
void per_peer_state_fdpass_send(int fd, const struct per_peer_state *pps);
|
|
|
|
#endif /* LIGHTNING_COMMON_PER_PEER_STATE_H */
|