Browse Source

parse autotor: address before separate_address_and_port

this enables addr like --addr=autotor:127.0.0.1 or
--addr=autotor:localhost to just use the default tor service port

Signed-off-by: Saibato <Saibato.naga@pm.me>
json-streaming
Saibato 6 years ago
committed by Christian Decker
parent
commit
d5c3626fa7
  1. 20
      common/wireaddr.c

20
common/wireaddr.c

@ -430,6 +430,16 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
return true;
}
/* 'autotor:' is a special prefix meaning talk to Tor to create
* an onion address. */
if (strstarts(arg, "autotor:")) {
addr->itype = ADDR_INTERNAL_AUTOTOR;
return parse_wireaddr(arg + strlen("autotor:"),
&addr->u.torservice, 9051,
dns_ok ? NULL : &needed_dns,
err_msg);
}
splitport = port;
if (!separate_address_and_port(tmpctx, arg, &ip, &splitport)) {
if (err_msg) {
@ -446,16 +456,6 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
return true;
}
/* 'autotor:' is a special prefix meaning talk to Tor to create
* an onion address. */
if (strstarts(arg, "autotor:")) {
addr->itype = ADDR_INTERNAL_AUTOTOR;
return parse_wireaddr(arg + strlen("autotor:"),
&addr->u.torservice, 9051,
dns_ok ? NULL : &needed_dns,
err_msg);
}
addr->itype = ADDR_INTERNAL_WIREADDR;
if (parse_wireaddr(arg, &addr->u.wireaddr, port,
dns_ok ? NULL : &needed_dns, err_msg))

Loading…
Cancel
Save