From c9435787cb72cdc76c5404c74b326c1826688974 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 24 Jul 2018 15:48:58 +0930 Subject: [PATCH] connectd: remove gossip-related fields. This almost completes the removal of the last vestages of gossipd. Signed-off-by: Rusty Russell --- connectd/connect.c | 18 ++---------------- connectd/connect_wire.csv | 5 ----- lightningd/connect_control.c | 6 ++---- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/connectd/connect.c b/connectd/connect.c index d98412457..75fb3b508 100644 --- a/connectd/connect.c +++ b/connectd/connect.c @@ -124,18 +124,12 @@ struct daemon { struct timers timers; - u32 broadcast_interval; - /* Important peers */ struct important_peerid_map important_peerids; /* Local and global features to offer to peers. */ u8 *localfeatures, *globalfeatures; - /* FIXME: Do not want. */ - u8 alias[33]; - u8 rgb[3]; - /* Addresses master told us to use */ struct wireaddr_internal *proposed_wireaddr; enum addr_listen_announce *proposed_listen_announce; @@ -153,9 +147,6 @@ struct daemon { bool use_proxy_always; char *tor_password; - /* Unapplied local updates waiting for their timers. */ - struct list_head local_updates; - /* @see lightningd.config.use_dns */ bool use_dns; @@ -1278,17 +1269,14 @@ static struct io_plan *connect_init(struct daemon_conn *master, struct daemon *daemon, const u8 *msg) { - struct bitcoin_blkid chain_hash; - u32 update_channel_interval; struct wireaddr *proxyaddr; struct wireaddr_internal *binding; if (!fromwire_connectctl_init( - daemon, msg, &daemon->broadcast_interval, &chain_hash, + daemon, msg, &daemon->id, &daemon->globalfeatures, &daemon->localfeatures, &daemon->proposed_wireaddr, - &daemon->proposed_listen_announce, daemon->rgb, - daemon->alias, &update_channel_interval, &daemon->reconnect, + &daemon->proposed_listen_announce, &daemon->reconnect, &proxyaddr, &daemon->use_proxy_always, &daemon->dev_allow_localhost, &daemon->use_dns, &daemon->tor_password)) { @@ -1923,10 +1911,8 @@ int main(int argc, char *argv[]) list_head_init(&daemon->reconnecting); list_head_init(&daemon->reaching); list_head_init(&daemon->addrhints); - list_head_init(&daemon->local_updates); important_peerid_map_init(&daemon->important_peerids); timers_init(&daemon->timers, time_mono()); - daemon->broadcast_interval = 30000; daemon->broken_resolver_response = NULL; daemon->listen_fds = tal_arr(daemon, int, 0); /* stdin == control */ diff --git a/connectd/connect_wire.csv b/connectd/connect_wire.csv index ba06b58e5..697bc4a0d 100644 --- a/connectd/connect_wire.csv +++ b/connectd/connect_wire.csv @@ -3,8 +3,6 @@ #include connectctl_init,2000 -connectctl_init,,broadcast_interval,u32 -connectctl_init,,chain_hash,struct bitcoin_blkid connectctl_init,,id,struct pubkey connectctl_init,,gflen,u16 connectctl_init,,gfeatures,gflen*u8 @@ -13,9 +11,6 @@ connectctl_init,,lfeatures,lflen*u8 connectctl_init,,num_wireaddrs,u16 connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce -connectctl_init,,rgb,3*u8 -connectctl_init,,alias,32*u8 -connectctl_init,,update_channel_interval,u32 connectctl_init,,reconnect,bool connectctl_init,,tor_proxyaddr,?struct wireaddr connectctl_init,,use_tor_proxy_always,bool diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 0c03aa27e..f745fd374 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -357,12 +357,10 @@ int connectd_init(struct lightningd *ld) } msg = towire_connectctl_init( - tmpctx, ld->config.broadcast_interval, - &get_chainparams(ld)->genesis_blockhash, &ld->id, + tmpctx, &ld->id, get_offered_global_features(tmpctx), get_offered_local_features(tmpctx), wireaddrs, - listen_announce, ld->rgb, - ld->alias, ld->config.channel_update_interval, ld->reconnect, + listen_announce, ld->reconnect, ld->proxyaddr, ld->use_proxy_always || ld->pure_tor_setup, allow_localhost, ld->config.use_dns, ld->tor_service_password ? ld->tor_service_password : "");