From 6ae30731731bc01d5faac8097db6e4332377dec4 Mon Sep 17 00:00:00 2001 From: Mark Friedenbach Date: Tue, 9 Oct 2012 14:26:33 -0700 Subject: [PATCH] Don't setup TOR proxy unless TOR proxy address is specified on the command-line, otherwise a segfault occurs. --- main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 5d572e0..853b437 100644 --- a/main.cpp +++ b/main.cpp @@ -349,10 +349,12 @@ int main(int argc, char **argv) { setbuf(stdout, NULL); CDnsSeedOpts opts; opts.ParseCommandLine(argc, argv); - CService service(opts.tor, 9050); - if (service.IsValid()) { - printf("Using Tor proxy at %s\n", service.ToStringIPPort().c_str()); - SetProxy(NET_TOR, service); + if (opts.tor) { + CService service(opts.tor, 9050); + if (service.IsValid()) { + printf("Using Tor proxy at %s\n", service.ToStringIPPort().c_str()); + SetProxy(NET_TOR, service); + } } bool fDNS = true; if (!opts.ns) {