Browse Source

gossip: Pass --channel-update-interval to gossipd

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
7fc8e3a4e2
  1. 14
      gossipd/gossip.c
  2. 1
      gossipd/gossip_wire.csv
  3. 12
      lightningd/gossip_control.c

14
gossipd/gossip.c

@ -81,6 +81,8 @@ struct daemon {
/* To make sure our node_announcement timestamps increase */
u32 last_announce_timestamp;
u32 update_channel_interval;
};
/* Peers we're trying to reach. */
@ -1307,13 +1309,11 @@ static struct io_plan *gossip_init(struct daemon_conn *master,
struct bitcoin_blkid chain_hash;
u16 port;
if (!fromwire_gossipctl_init(daemon, msg, NULL,
&daemon->broadcast_interval,
&chain_hash, &daemon->id, &port,
&daemon->globalfeatures,
&daemon->localfeatures,
&daemon->wireaddrs,
daemon->rgb, daemon->alias)) {
if (!fromwire_gossipctl_init(
daemon, msg, NULL, &daemon->broadcast_interval, &chain_hash,
&daemon->id, &port, &daemon->globalfeatures,
&daemon->localfeatures, &daemon->wireaddrs, daemon->rgb,
daemon->alias, &daemon->update_channel_interval)) {
master_badmsg(WIRE_GOSSIPCTL_INIT, msg);
}
daemon->rstate = new_routing_state(daemon, &chain_hash, &daemon->id);

1
gossipd/gossip_wire.csv

@ -16,6 +16,7 @@ gossipctl_init,,num_wireaddrs,u16
gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr
gossipctl_init,,rgb,3*u8
gossipctl_init,,alias,32*u8
gossipctl_init,,update_channel_interval,u32
# Master -> gossipd: Optional hint for where to find peer.
gossipctl_peer_addrhint,3014

Can't render this file because it has a wrong number of fields in line 5.

12
lightningd/gossip_control.c

@ -163,12 +163,12 @@ void gossip_init(struct lightningd *ld)
if (!ld->gossip)
err(1, "Could not subdaemon gossip");
msg = towire_gossipctl_init(tmpctx, ld->config.broadcast_interval,
&get_chainparams(ld)->genesis_blockhash,
&ld->id, ld->portnum,
get_supported_global_features(tmpctx),
get_supported_local_features(tmpctx),
ld->wireaddrs, ld->rgb, ld->alias);
msg = towire_gossipctl_init(
tmpctx, ld->config.broadcast_interval,
&get_chainparams(ld)->genesis_blockhash, &ld->id, ld->portnum,
get_supported_global_features(tmpctx),
get_supported_local_features(tmpctx), ld->wireaddrs, ld->rgb,
ld->alias, ld->config.channel_update_interval);
subd_send_msg(ld->gossip, msg);
tal_free(tmpctx);
}

Loading…
Cancel
Save