Move always-use-proxy auto-override to master daemon.

This means it will effect connect commands too (though it's too
late to stop DNS lookups caused by commandline options).

We also warn that this is one case where we allow forcing through Tor
without a proxy set: it just means all connections will fail.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-05-10 08:48:24 +09:30
parent 1106c40217
commit 89c76a5a78
10 changed files with 43 additions and 23 deletions

View File

@@ -839,6 +839,15 @@ void handle_opts(struct lightningd *ld, int argc, char *argv[])
if (argc != 1)
errx(1, "no arguments accepted");
/* We keep a separate variable rather than overriding use_proxy_always,
* so listconfigs shows the correct thing. */
if (tal_count(ld->proposed_wireaddr) != 0
&& all_tor_addresses(ld->proposed_wireaddr)) {
ld->pure_tor_setup = true;
if (!ld->proxyaddr)
log_info(ld->log, "Pure Tor setup with no --proxy:"
" you won't be able to make connections out");
}
check_config(ld);
}