diff --git a/common/wireaddr.c b/common/wireaddr.c index 8f2f2819b..1ff8ca132 100644 --- a/common/wireaddr.c +++ b/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))