mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 16:14:26 +01:00
gossip: Network pruning loop every channel-update-interval/2 seconds
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
7fc8e3a4e2
commit
4470612016
@@ -1197,6 +1197,14 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void gossip_prune_network(struct daemon *daemon)
|
||||
{
|
||||
/* Schedule next run now */
|
||||
new_reltimer(&daemon->timers, daemon,
|
||||
time_from_sec(daemon->update_channel_interval/2),
|
||||
gossip_prune_network, daemon);
|
||||
|
||||
}
|
||||
static struct io_plan *connection_in(struct io_conn *conn, struct daemon *daemon)
|
||||
{
|
||||
struct wireaddr addr;
|
||||
@@ -1319,6 +1327,11 @@ static struct io_plan *gossip_init(struct daemon_conn *master,
|
||||
daemon->rstate = new_routing_state(daemon, &chain_hash, &daemon->id);
|
||||
|
||||
setup_listeners(daemon, port);
|
||||
|
||||
new_reltimer(&daemon->timers, daemon,
|
||||
time_from_sec(daemon->update_channel_interval/2),
|
||||
gossip_prune_network, daemon);
|
||||
|
||||
return daemon_conn_read_next(master->conn, master);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user