mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
wireaddr: tell caller that we failed due to wanting DNS lookup, don't try.
This is useful for the next patch, where we want to hand the unresolved name through to the proxy. This also addresses @Saibato's worry that we still called getaddrinfo() (with the AI_NUMERICHOST option) even if we didn't want a lookup. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -299,15 +299,17 @@ static char *opt_set_offline(struct lightningd *ld)
|
||||
|
||||
static char *opt_add_proxy_addr(const char *arg, struct lightningd *ld)
|
||||
{
|
||||
bool needed_dns;
|
||||
tal_free(ld->proxyaddr);
|
||||
|
||||
/* We use a tal_arr here, so we can marshal it to gossipd */
|
||||
ld->proxyaddr = tal_arr(ld, struct wireaddr, 1);
|
||||
|
||||
if (!parse_wireaddr(arg, ld->proxyaddr, 9050, !ld->use_proxy_always,
|
||||
if (!parse_wireaddr(arg, ld->proxyaddr, 9050,
|
||||
ld->use_proxy_always ? &needed_dns : NULL,
|
||||
NULL)) {
|
||||
return tal_fmt(NULL, "Unable to parse Tor proxy address '%s'",
|
||||
arg);
|
||||
return tal_fmt(NULL, "Unable to parse Tor proxy address '%s' %s",
|
||||
arg, needed_dns ? " (needed dns)" : "");
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user