diff options
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/init.cpp b/src/init.cpp index b89c9edf89..60927f20b3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -178,12 +178,17 @@ bool AppInit2(int argc, char* argv[]) " -dbcache=<n> \t\t " + _("Set database cache size in megabytes (default: 25)") + "\n" + " -dblogsize=<n> \t\t " + _("Set database disk log size in megabytes (default: 100)") + "\n" + " -timeout=<n> \t " + _("Specify connection timeout (in milliseconds)") + "\n" + - " -proxy=<ip:port> \t " + _("Connect through socks4 proxy") + "\n" + - " -dns \t " + _("Allow DNS lookups for addnode and connect") + "\n" + + " -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, -seednode 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" + " -connect=<ip> \t\t " + _("Connect only to the specified node") + "\n" + + " -seednode=<ip> \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + + " -externalip=<ip> \t " + _("Specify your own public address") + "\n" + + " -discover \t " + _("Try to discover public IP address (default: 1)") + "\n" + " -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" + " -listen \t " + _("Accept connections from outside (default: 1)") + "\n" + #ifdef QT_GUI @@ -527,6 +532,9 @@ bool AppInit2(int argc, char* argv[]) } } + if (mapArgs.count("-connect")) + SoftSetBoolArg("-dnsseed", false); + bool fTor = (fUseProxy && addrProxy.GetPort() == 9050); if (fTor) { @@ -534,13 +542,20 @@ 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); + SoftSetBoolArg("-discover", false); } - fAllowDNS = GetBoolArg("-dns"); + fNameLookup = GetBoolArg("-dns"); + fProxyNameLookup = GetBoolArg("-proxydns"); + if (fProxyNameLookup) + fNameLookup = true; fNoListen = !GetBoolArg("-listen", true); + nSocksVersion = GetArg("-socks", 5); + + BOOST_FOREACH(string strDest, mapMultiArgs["-seednode"]) + AddOneShot(strDest); // Continue to put "/P2SH/" in the coinbase to monitor // BIP16 support. @@ -558,15 +573,10 @@ bool AppInit2(int argc, char* argv[]) } } - if (mapArgs.count("-addnode")) + if (mapArgs.count("-externalip")) { - 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")); - } + BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) + AddLocal(CNetAddr(strAddr, fNameLookup), LOCAL_MANUAL); } if (mapArgs.count("-paytxfee")) |