cli: getinfo output to regard --ip-discovery

This commit is contained in:
Michael Schmoock
2022-12-21 17:32:13 +01:00
parent 30dea0a431
commit 34cfc93939

View File

@@ -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,