From 34cfc93939d56e4009f10adc357807924669c58a Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Wed, 21 Dec 2022 17:32:13 +0100 Subject: [PATCH] cli: getinfo output to regard --ip-discovery --- lightningd/peer_control.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 9718d136c..b84e76a7b 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -2383,10 +2383,10 @@ static struct command_result *json_getinfo(struct command *cmd, for (size_t i = 0; i < count_announceable; i++) json_add_address(response, NULL, cmd->ld->announceable+i); - /* Currently, IP discovery will only be announced by gossipd, - * if we don't already have usable addresses. - * See `create_node_announcement` in `gossip_generation.c`. */ - if (count_announceable == 0) { + /* Add discovered IPs if we announce them. + * Also see `create_node_announcement` in `gossip_generation.c`. */ + if ((cmd->ld->config.ip_discovery == OPT_AUTOBOOL_AUTO && count_announceable == 0) || + cmd->ld->config.ip_discovery == OPT_AUTOBOOL_TRUE) { if (cmd->ld->discovered_ip_v4 != NULL && !wireaddr_arr_contains( cmd->ld->announceable,