mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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>
This commit is contained in:
committed by
Christian Decker
parent
4198cb34a2
commit
d5c3626fa7
@@ -430,6 +430,16 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
|
|||||||
return true;
|
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;
|
splitport = port;
|
||||||
if (!separate_address_and_port(tmpctx, arg, &ip, &splitport)) {
|
if (!separate_address_and_port(tmpctx, arg, &ip, &splitport)) {
|
||||||
if (err_msg) {
|
if (err_msg) {
|
||||||
@@ -446,16 +456,6 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
|
|||||||
return true;
|
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;
|
addr->itype = ADDR_INTERNAL_WIREADDR;
|
||||||
if (parse_wireaddr(arg, &addr->u.wireaddr, port,
|
if (parse_wireaddr(arg, &addr->u.wireaddr, port,
|
||||||
dns_ok ? NULL : &needed_dns, err_msg))
|
dns_ok ? NULL : &needed_dns, err_msg))
|
||||||
|
|||||||
Reference in New Issue
Block a user