connectd: disable advertizement of WEBSOCKET addresses.

This seems to prevent broad propagation, due to LND not allowing it.  See
	https://github.com/lightningnetwork/lnd/issues/6432

We still announce it if you disable deprecated-apis, so tests still work,
and hopefully we can enable it in future.

Fixes: #5196
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: Protocol: disabled websocket announcement due to LND propagation issues
This commit is contained in:
Rusty Russell
2022-04-20 20:32:04 +09:30
parent 393e8e5e6a
commit 37e8d2fb0f
5 changed files with 18 additions and 5 deletions

View File

@@ -1397,10 +1397,15 @@ setup_listeners(const tal_t *ctx,
* different type.
*/
if (tal_count(*announceable) != 0) {
wireaddr_from_websocket(&addr.u.wireaddr,
daemon->websocket_port);
add_announceable(announceable,
&addr.u.wireaddr);
/* See https://github.com/lightningnetwork/lnd/issues/6432:
* if we add websocket to the node_announcement, it doesn't propagate.
* So we do not do this for now in general! */
if (daemon->announce_websocket) {
wireaddr_from_websocket(&addr.u.wireaddr,
daemon->websocket_port);
add_announceable(announceable,
&addr.u.wireaddr);
}
} else {
status_unusual("Bound to websocket %s,"
" but we cannot announce"
@@ -1535,6 +1540,7 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
&daemon->timeout_secs,
&daemon->websocket_helper,
&daemon->websocket_port,
&daemon->announce_websocket,
&dev_fast_gossip,
&dev_disconnect,
&dev_no_ping_timer)) {

View File

@@ -188,6 +188,9 @@ struct daemon {
int gossip_store_fd;
size_t gossip_store_end;
/* We only announce websocket addresses if !deprecated_apis */
bool announce_websocket;
#if DEVELOPER
/* Hack to speed up gossip timer */
bool dev_fast_gossip;

View File

@@ -22,6 +22,7 @@ msgdata,connectd_init,use_v3_autotor,bool,
msgdata,connectd_init,timeout_secs,u32,
msgdata,connectd_init,websocket_helper,wirestring,
msgdata,connectd_init,websocket_port,u16,
msgdata,connectd_init,announce_websocket,bool,
msgdata,connectd_init,dev_fast_gossip,bool,
# If this is set, then fd 5 is dev_disconnect_fd.
msgdata,connectd_init,dev_disconnect,bool,
1 #include <bitcoin/block.h>
22 msgdata,connectd_init,websocket_helper,wirestring,
23 msgdata,connectd_init,websocket_port,u16,
24 msgdata,connectd_init,dev_fast_gossip,bool, msgdata,connectd_init,announce_websocket,bool,
25 msgdata,connectd_init,dev_fast_gossip,bool,
26 # If this is set, then fd 5 is dev_disconnect_fd.
27 msgdata,connectd_init,dev_disconnect,bool,
28 msgdata,connectd_init,dev_no_ping_timer,bool,