| 1410 | } |
| 1411 | |
| 1412 | void handle_opts(struct lightningd *ld, int argc, char *argv[]) |
| 1413 | { |
| 1414 | /* Now look for config file, but only handle non-early |
| 1415 | * options, early ones have been parsed in |
| 1416 | * handle_early_opts */ |
| 1417 | parse_config_files(ld->config_filename, ld->config_basedir, false); |
| 1418 | |
| 1419 | /* Now parse cmdline, which overrides config. */ |
| 1420 | opt_parse(&argc, argv, opt_log_stderr_exitcode); |
| 1421 | if (argc != 1) |
| 1422 | errx(1, "no arguments accepted"); |
| 1423 | /* We keep a separate variable rather than overriding always_use_proxy, |
| 1424 | * so listconfigs shows the correct thing. */ |
| 1425 | if (tal_count(ld->proposed_wireaddr) != 0 |
| 1426 | && all_tor_addresses(ld->proposed_wireaddr)) { |
| 1427 | ld->pure_tor_setup = true; |
| 1428 | if (!ld->proxyaddr) |
| 1429 | log_info(ld->log, "Pure Tor setup with no --proxy:" |
| 1430 | " you won't be able to make connections out"); |
| 1431 | } |
| 1432 | check_config(ld); |
| 1433 | } |
| 1434 | |
| 1435 | /* FIXME: This is a hack! Expose somehow in ccan/opt.*/ |
| 1436 | /* Returns string after first '-'. */ |
no test coverage detected