Don't setup TOR proxy unless TOR proxy address is specified on the command-line, otherwise a segfault occurs.

This commit is contained in:
Mark Friedenbach 2012-10-09 14:26:33 -07:00
parent 2c1cd71d39
commit 6ae3073173
1 changed files with 6 additions and 4 deletions

View File

@ -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) {