diff --git a/common/wireaddr.c b/common/wireaddr.c index f43368400..4246a460c 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -337,6 +337,7 @@ bool separate_address_and_port(const tal_t *ctx, const char *arg, *port = strtol(portcolon + 1, &endp, 10); return *port != 0 && *endp == '\0'; } + return true; } diff --git a/lightningd/options.c b/lightningd/options.c index 45a01ca45..be6c159c4 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -226,6 +226,8 @@ static char *opt_add_addr_withtype(const char *arg, assert(arg != NULL); dns_ok = !ld->always_use_proxy && ld->config.use_dns; + /* Will be overridden in next call iff has port */ + port = 0; if (!separate_address_and_port(tmpctx, arg, &address, &port)) return tal_fmt(NULL, "Unable to parse address:port '%s'", arg);