diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-04-19 17:38:03 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-05-04 16:11:54 +0200 |
commit | 9bab521df895c149579b9e64931405c56b008afb (patch) | |
tree | 18177aabb6eb11265e3500a75abcdd6bf1150c86 /src/init.cpp | |
parent | a012e2db59585bfa1978615aacade281053e0ae5 (diff) |
Support connecting by hostnames passed to proxy (-proxydns)
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/init.cpp b/src/init.cpp index aa1399f813..35da20336c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -181,6 +181,7 @@ bool AppInit2(int argc, char* argv[]) " -proxy=<ip:port> \t " + _("Connect through socks proxy") + "\n" + " -socks=<n> \t " + _("Select the version of socks proxy to use (4 or 5, 5 is default)") + "\n" + " -dns \t " + _("Allow DNS lookups for addnode and connect") + "\n" + + " -proxydns \t " + _("Pass DNS requests to (SOCKS5) proxy") + "\n" + " -port=<port> \t\t " + _("Listen for connections on <port> (default: 8333 or testnet: 18333)") + "\n" + " -maxconnections=<n>\t " + _("Maintain at most <n> connections to peers (default: 125)") + "\n" + " -addnode=<ip> \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + @@ -524,13 +525,16 @@ bool AppInit2(int argc, char* argv[]) // Note: the GetBoolArg() calls for all of these must happen later. SoftSetBoolArg("-listen", false); SoftSetBoolArg("-irc", false); - SoftSetBoolArg("-dnsseed", false); + SoftSetBoolArg("-proxydns", true); SoftSetBoolArg("-upnp", false); - SoftSetBoolArg("-dns", false); } - fAllowDNS = GetBoolArg("-dns"); + fNameLookup = GetBoolArg("-dns"); + fProxyNameLookup = GetBoolArg("-proxydns"); + if (fProxyNameLookup) + fNameLookup = true; fNoListen = !GetBoolArg("-listen", true); + nSocksVersion = GetArg("-socks", 5); // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. @@ -548,17 +552,6 @@ bool AppInit2(int argc, char* argv[]) } } - if (mapArgs.count("-addnode")) - { - BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"]) - { - CAddress addr(CService(strAddr, GetDefaultPort(), fAllowDNS)); - addr.nTime = 0; // so it won't relay unless successfully connected - if (addr.IsValid()) - addrman.Add(addr, CNetAddr("127.0.0.1")); - } - } - if (mapArgs.count("-paytxfee")) { if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) |