mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +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,2000
|
||||||
connectctl_init,,id,struct pubkey
|
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,,num_wireaddrs,u16
|
||||||
connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal
|
connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal
|
||||||
connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce
|
connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce
|
||||||
|
|
|
|
@ -124,9 +124,6 @@ struct daemon {
|
||||||
/* Connection to main daemon. */
|
/* Connection to main daemon. */
|
||||||
struct daemon_conn *master;
|
struct daemon_conn *master;
|
||||||
|
|
||||||
/* Local and global features to offer to peers. */
|
|
||||||
u8 *localfeatures, *globalfeatures;
|
|
||||||
|
|
||||||
/* Allow localhost to be considered "public": DEVELOPER-only option,
|
/* Allow localhost to be considered "public": DEVELOPER-only option,
|
||||||
* but for simplicity we don't #if DEVELOPER-wrap it here. */
|
* but for simplicity we don't #if DEVELOPER-wrap it here. */
|
||||||
bool dev_allow_localhost;
|
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;
|
/*~ The way features generally work is that both sides need to offer it;
|
||||||
* we always offer `gossip_queries`, but this check is explicit. */
|
* we always offer `gossip_queries`, but this check is explicit. */
|
||||||
gossip_queries_feature
|
gossip_queries_feature
|
||||||
= feature_offered(localfeatures, LOCAL_GOSSIP_QUERIES)
|
= local_feature_negotiated(localfeatures, LOCAL_GOSSIP_QUERIES);
|
||||||
&& feature_offered(daemon->localfeatures,
|
|
||||||
LOCAL_GOSSIP_QUERIES);
|
|
||||||
|
|
||||||
/*~ `initial_routing_sync is supported by every node, since it was in
|
/*~ `initial_routing_sync is supported by every node, since it was in
|
||||||
* the initial lightning specification: it means the peer wants the
|
* 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 */
|
/* Fields which require allocation are allocated off daemon */
|
||||||
if (!fromwire_connectctl_init(
|
if (!fromwire_connectctl_init(
|
||||||
daemon, msg,
|
daemon, msg,
|
||||||
&daemon->id, &daemon->globalfeatures,
|
&daemon->id,
|
||||||
&daemon->localfeatures, &proposed_wireaddr,
|
&proposed_wireaddr,
|
||||||
&proposed_listen_announce,
|
&proposed_listen_announce,
|
||||||
&proxyaddr, &daemon->use_proxy_always,
|
&proxyaddr, &daemon->use_proxy_always,
|
||||||
&daemon->dev_allow_localhost, &daemon->use_dns,
|
&daemon->dev_allow_localhost, &daemon->use_dns,
|
||||||
|
|
|
@ -367,8 +367,7 @@ int connectd_init(struct lightningd *ld)
|
||||||
|
|
||||||
msg = towire_connectctl_init(
|
msg = towire_connectctl_init(
|
||||||
tmpctx, &ld->id,
|
tmpctx, &ld->id,
|
||||||
get_offered_globalfeatures(tmpctx),
|
wireaddrs,
|
||||||
get_offered_localfeatures(tmpctx), wireaddrs,
|
|
||||||
listen_announce,
|
listen_announce,
|
||||||
ld->proxyaddr, ld->use_proxy_always || ld->pure_tor_setup,
|
ld->proxyaddr, ld->use_proxy_always || ld->pure_tor_setup,
|
||||||
allow_localhost, ld->config.use_dns,
|
allow_localhost, ld->config.use_dns,
|
||||||
|
|
Loading…
Add table
Reference in a new issue