mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 14:54: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:
@@ -1932,8 +1932,7 @@ static struct io_plan *conn_proxy_init(struct io_conn *conn,
|
||||
}
|
||||
|
||||
static struct addrhint *
|
||||
seed_resolve_addr(const tal_t *ctx, const struct pubkey *id, const u16 port,
|
||||
bool dns_ok)
|
||||
seed_resolve_addr(const tal_t *ctx, const struct pubkey *id, const u16 port)
|
||||
{
|
||||
struct addrhint *a;
|
||||
char bech32[100], *addr;
|
||||
@@ -1949,7 +1948,7 @@ seed_resolve_addr(const tal_t *ctx, const struct pubkey *id, const u16 port,
|
||||
|
||||
a = tal(ctx, struct addrhint);
|
||||
a->addr.itype = ADDR_INTERNAL_WIREADDR;
|
||||
if (!wireaddr_from_hostname(&a->addr.u.wireaddr, addr, port, dns_ok,
|
||||
if (!wireaddr_from_hostname(&a->addr.u.wireaddr, addr, port, NULL,
|
||||
NULL)) {
|
||||
status_trace("Could not resolve %s", addr);
|
||||
return tal_free(a);
|
||||
@@ -2036,9 +2035,8 @@ static void try_reach_peer(struct daemon *daemon, const struct pubkey *id,
|
||||
daemon->rstate,
|
||||
id);
|
||||
|
||||
if (!a)
|
||||
a = seed_resolve_addr(tmpctx, id, 9735,
|
||||
!daemon->use_proxy_always);
|
||||
if (!a && !daemon->use_proxy_always)
|
||||
a = seed_resolve_addr(tmpctx, id, 9735);
|
||||
|
||||
if (!a) {
|
||||
status_debug("No address known for %s, giving up",
|
||||
|
||||
Reference in New Issue
Block a user