From 60a87bce873ce1f76a80b7b8546e83a0cd4e07a5 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 1 Apr 2012 20:25:48 +0200 Subject: SOCKS5 support by default Add -socks= to select SOCKS version to use. 4 and 5 are supported, 5 is default. --- src/init.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 3fe6d1b09..aa1399f81 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -178,7 +178,8 @@ bool AppInit2(int argc, char* argv[]) " -dbcache= \t\t " + _("Set database cache size in megabytes (default: 25)") + "\n" + " -dblogsize= \t\t " + _("Set database disk log size in megabytes (default: 100)") + "\n" + " -timeout= \t " + _("Specify connection timeout (in milliseconds)") + "\n" + - " -proxy= \t " + _("Connect through socks4 proxy") + "\n" + + " -proxy= \t " + _("Connect through socks proxy") + "\n" + + " -socks= \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" + " -port= \t\t " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n" + " -maxconnections=\t " + _("Maintain at most connections to peers (default: 125)") + "\n" + -- cgit v1.2.3 From 9bab521df895c149579b9e64931405c56b008afb Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 19 Apr 2012 17:38:03 +0200 Subject: Support connecting by hostnames passed to proxy (-proxydns) --- src/init.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index aa1399f81..35da20336 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -181,6 +181,7 @@ bool AppInit2(int argc, char* argv[]) " -proxy= \t " + _("Connect through socks proxy") + "\n" + " -socks= \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= \t\t " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n" + " -maxconnections=\t " + _("Maintain at most connections to peers (default: 125)") + "\n" + " -addnode= \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)) -- cgit v1.2.3 From 478b01d9a797f3ea41cca141992b161867a5996d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 24 Apr 2012 02:15:00 +0200 Subject: Add -seednode connections, and use this for -dnsseed + -proxydns --- src/init.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 35da20336..f9ea998ce 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -180,12 +180,13 @@ bool AppInit2(int argc, char* argv[]) " -timeout= \t " + _("Specify connection timeout (in milliseconds)") + "\n" + " -proxy= \t " + _("Connect through socks proxy") + "\n" + " -socks= \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" + + " -dns \t " + _("Allow DNS lookups for -addnode, -seednode and -connect") + "\n" + " -proxydns \t " + _("Pass DNS requests to (SOCKS5) proxy") + "\n" + " -port= \t\t " + _("Listen for connections on (default: 8333 or testnet: 18333)") + "\n" + " -maxconnections=\t " + _("Maintain at most connections to peers (default: 125)") + "\n" + " -addnode= \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect= \t\t " + _("Connect only to the specified node") + "\n" + + " -seednode= \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + " -irc \t " + _("Find peers using internet relay chat (default: 0)") + "\n" + " -listen \t " + _("Accept connections from outside (default: 1)") + "\n" + #ifdef QT_GUI @@ -536,6 +537,9 @@ bool AppInit2(int argc, char* argv[]) 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. // This can be removed eventually... -- cgit v1.2.3 From 19b6958cfd5c5207ffe8259ef48ebbd24ca89725 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 19 Feb 2012 20:44:35 +0100 Subject: Added -externalip and -discover -externalip= can be used to explicitly set the public IP address of your node. -discover=0 can be used to disable the automatic public IP discovery system. --- src/init.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index f9ea998ce..469642897 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -187,6 +187,8 @@ bool AppInit2(int argc, char* argv[]) " -addnode= \t " + _("Add a node to connect to and attempt to keep the connection open") + "\n" + " -connect= \t\t " + _("Connect only to the specified node") + "\n" + " -seednode= \t\t " + _("Connect to a node to retrieve peer addresses, and disconnect") + "\n" + + " -externalip= \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 @@ -519,6 +521,9 @@ bool AppInit2(int argc, char* argv[]) } } + if (mapArgs.count("-connect")) + SoftSetBoolArg("-dnsseed", false); + bool fTor = (fUseProxy && addrProxy.GetPort() == 9050); if (fTor) { @@ -528,6 +533,7 @@ bool AppInit2(int argc, char* argv[]) SoftSetBoolArg("-irc", false); SoftSetBoolArg("-proxydns", true); SoftSetBoolArg("-upnp", false); + SoftSetBoolArg("-discover", false); } fNameLookup = GetBoolArg("-dns"); @@ -556,6 +562,12 @@ bool AppInit2(int argc, char* argv[]) } } + if (mapArgs.count("-externalip")) + { + BOOST_FOREACH(string strAddr, mapMultiArgs["-externalip"]) + AddLocal(CNetAddr(strAddr, fNameLookup), LOCAL_MANUAL); + } + if (mapArgs.count("-paytxfee")) { if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) -- cgit v1.2.3