mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
connectd: simply use global features from common/features.
We currently hand the feature set from lightningd, but that's confusing if they were ever different. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
be6322a2d3
commit
d613b3fa9d
3 changed files with 4 additions and 14 deletions
|
@ -4,10 +4,6 @@
|
|||
|
||||
connectctl_init,2000
|
||||
connectctl_init,,id,struct pubkey
|
||||
connectctl_init,,gflen,u16
|
||||
connectctl_init,,globalfeatures,gflen*u8
|
||||
connectctl_init,,lflen,u16
|
||||
connectctl_init,,localfeatures,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
|
||||
|
|
|
|
@ -124,9 +124,6 @@ struct daemon {
|
|||
/* Connection to main daemon. */
|
||||
struct daemon_conn *master;
|
||||
|
||||
/* Local and global features to offer to peers. */
|
||||
u8 *localfeatures, *globalfeatures;
|
||||
|
||||
/* Allow localhost to be considered "public": DEVELOPER-only option,
|
||||
* but for simplicity we don't #if DEVELOPER-wrap it here. */
|
||||
bool dev_allow_localhost;
|
||||
|
@ -289,9 +286,7 @@ static int get_gossipfd(struct daemon *daemon,
|
|||
/*~ The way features generally work is that both sides need to offer it;
|
||||
* we always offer `gossip_queries`, but this check is explicit. */
|
||||
gossip_queries_feature
|
||||
= feature_offered(localfeatures, LOCAL_GOSSIP_QUERIES)
|
||||
&& feature_offered(daemon->localfeatures,
|
||||
LOCAL_GOSSIP_QUERIES);
|
||||
= local_feature_negotiated(localfeatures, LOCAL_GOSSIP_QUERIES);
|
||||
|
||||
/*~ `initial_routing_sync is supported by every node, since it was in
|
||||
* the initial lightning specification: it means the peer wants the
|
||||
|
@ -1102,8 +1097,8 @@ static struct io_plan *connect_init(struct io_conn *conn,
|
|||
/* Fields which require allocation are allocated off daemon */
|
||||
if (!fromwire_connectctl_init(
|
||||
daemon, msg,
|
||||
&daemon->id, &daemon->globalfeatures,
|
||||
&daemon->localfeatures, &proposed_wireaddr,
|
||||
&daemon->id,
|
||||
&proposed_wireaddr,
|
||||
&proposed_listen_announce,
|
||||
&proxyaddr, &daemon->use_proxy_always,
|
||||
&daemon->dev_allow_localhost, &daemon->use_dns,
|
||||
|
|
|
@ -367,8 +367,7 @@ int connectd_init(struct lightningd *ld)
|
|||
|
||||
msg = towire_connectctl_init(
|
||||
tmpctx, &ld->id,
|
||||
get_offered_globalfeatures(tmpctx),
|
||||
get_offered_localfeatures(tmpctx), wireaddrs,
|
||||
wireaddrs,
|
||||
listen_announce,
|
||||
ld->proxyaddr, ld->use_proxy_always || ld->pure_tor_setup,
|
||||
allow_localhost, ld->config.use_dns,
|
||||
|
|
Loading…
Add table
Reference in a new issue