diff -uNr a/bitcoin/src/init.cpp b/bitcoin/src/init.cpp
--- a/bitcoin/src/init.cpp b7efbc0ce8eb70c04b3b0f713aa9dbeacf9dfe913be38d32ae83a9eb63024f752c4b98df5e019378e721a9b4c6a1e6466797caa1b0b80b4d672771dcfd8c5202
+++ b/bitcoin/src/init.cpp d782e9b44727fe886dd474e6ce421141fa6a9e4cd91b937bd55f46cb85056b0207c570294a1fce7f666075df6492ce649bdf0795e4bee9a2b811090170bc93b3
@@ -160,7 +160,6 @@
" -datadir=
\t\t " + _("Specify data directory\n") +
" -timeout= \t " + _("Specify connection timeout (in milliseconds)\n") +
" -proxy= \t " + _("Connect through socks4 proxy\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") +
" -addnode= \t " + _("Add a node to connect to\n") +
@@ -414,10 +413,8 @@
// Note: the GetBoolArg() calls for all of these must happen later.
SoftSetArg("-nolisten", true);
SoftSetArg("-noirc", true);
- SoftSetArg("-dns", false);
}
- fAllowDNS = GetBoolArg("-dns");
fNoListen = GetBoolArg("-nolisten");
// Command-line args override in-wallet settings:
@@ -435,7 +432,7 @@
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
{
- CAddress addr(strAddr, fAllowDNS);
+ CAddress addr(strAddr);
addr.nTime = 0; // so it won't relay unless successfully connected
if (addr.IsValid())
AddAddress(addr);
diff -uNr a/bitcoin/src/irc.cpp b/bitcoin/src/irc.cpp
--- a/bitcoin/src/irc.cpp fc9388561ae8af72ab6f10816cacd133746de668b500bae02c239b129dc5e190794a94d7569b7ecbd294844bfe3c2a3a2b5c4e2a0a5f3aa3170da498a8d0724b
+++ b/bitcoin/src/irc.cpp 1f5eac2f3c61801c5bce81a6b89d2c3b4bea56a652664148dd45cb895385d27c0bcb58c2e8ba5ad32cb330e14d3bd7ef0cbdaba8323350a10837a7daaf956ab2
@@ -269,10 +269,6 @@
{
CAddress addrConnect("92.243.23.21", 6667); // irc.lfnet.org
- CAddress addrIRC("irc.lfnet.org", 6667, true);
- if (addrIRC.IsValid())
- addrConnect = addrIRC;
-
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
{
diff -uNr a/bitcoin/src/net.cpp b/bitcoin/src/net.cpp
--- a/bitcoin/src/net.cpp e49a09443eb1aaf45252696f1731c346c18efa2fbc3b64d87eda63e126cc4dd44608b9c554c80dcd112ec5a050cf5a937b6a302d03dca89c8543f03cefbfa17c
+++ b/bitcoin/src/net.cpp e8735147d6e6bf1e60e12386590feea17b8790faf114669194c1dbe551e184067bf8d0bfeb97ac257ee1fca645eacc51439a7a1d55e4053178e454c52b16e2a3
@@ -29,9 +29,8 @@
// Global state variables
//
bool fClient = false;
-bool fAllowDNS = false;
uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
-CAddress addrLocalHost("0.0.0.0", 0, false, nLocalServices);
+CAddress addrLocalHost("0.0.0.0", 0, nLocalServices);
static CNode* pnodeLocalHost = NULL;
uint64 nLocalHostNonce = 0;
array vnThreadsRunning;
@@ -193,7 +192,7 @@
}
// portDefault is in host order
-bool Lookup(const char *pszName, vector& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup, int portDefault, bool fAllowPort)
+bool Lookup(const char *pszName, vector& vaddr, int nServices, int nMaxSolutions, int portDefault, bool fAllowPort)
{
vaddr.clear();
if (pszName[0] == 0)
@@ -231,33 +230,14 @@
return true;
}
- if (!fAllowLookup)
- return false;
-
- struct hostent* phostent = gethostbyname(pszHost);
- if (!phostent)
- return false;
-
- if (phostent->h_addrtype != AF_INET)
- return false;
-
- char** ppAddr = phostent->h_addr_list;
- while (*ppAddr != NULL && vaddr.size() != nMaxSolutions)
- {
- CAddress addr(((struct in_addr*)ppAddr[0])->s_addr, port, nServices);
- if (addr.IsValid())
- vaddr.push_back(addr);
- ppAddr++;
- }
-
- return (vaddr.size() > 0);
+ return false;
}
// portDefault is in host order
-bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup, int portDefault, bool fAllowPort)
+bool Lookup(const char *pszName, CAddress& addr, int nServices, int portDefault, bool fAllowPort)
{
vector vaddr;
- bool fRet = Lookup(pszName, vaddr, nServices, 1, fAllowLookup, portDefault, fAllowPort);
+ bool fRet = Lookup(pszName, vaddr, nServices, 1, portDefault, fAllowPort);
if (fRet)
addr = vaddr[0];
return fRet;
@@ -972,7 +952,7 @@
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-connect"])
{
- CAddress addr(strAddr, fAllowDNS);
+ CAddress addr(strAddr);
if (addr.IsValid())
OpenNetworkConnection(addr);
for (int i = 0; i < 10 && i < nLoop; i++)
@@ -990,7 +970,7 @@
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
{
- CAddress addr(strAddr, fAllowDNS);
+ CAddress addr(strAddr);
if (addr.IsValid())
{
OpenNetworkConnection(addr);
@@ -1275,7 +1255,7 @@
void StartNode(void* parg)
{
if (pnodeLocalHost == NULL)
- pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", 0, false, nLocalServices));
+ pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", 0, nLocalServices));
// Get local host ip
struct ifaddrs* myaddrs;
diff -uNr a/bitcoin/src/net.h b/bitcoin/src/net.h
--- a/bitcoin/src/net.h 08231aa424ae8c84086b5b82ea79a7f22fb3403b4245c6d05a20176c4962ae620a35b9cb2505f4b8e33a8f43d077152406007013e49e97ab1ceed6b158b77a0f
+++ b/bitcoin/src/net.h d36484a4290d22c5cedda2a3020543819514e1d2404c3064b2a8c64fc210300681a24156cbb5c3cbc2d4da56de970f1769baa7aae48f0dead0c3a2d88f0d5224
@@ -26,8 +26,8 @@
static const unsigned int PUBLISH_HOPS = 5;
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout=nConnectTimeout);
-bool Lookup(const char *pszName, std::vector& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
-bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
+bool Lookup(const char *pszName, std::vector& vaddr, int nServices, int nMaxSolutions, int portDefault = 0, bool fAllowPort = false);
+bool Lookup(const char *pszName, CAddress& addr, int nServices, int portDefault = 0, bool fAllowPort = false);
bool GetMyExternalIP(unsigned int& ipRet);
bool AddAddress(CAddress addr, int64 nTimePenalty=0, CAddrDB *pAddrDB=NULL);
void AddressCurrentlyConnected(const CAddress& addr);
diff -uNr a/bitcoin/src/protocol.cpp b/bitcoin/src/protocol.cpp
--- a/bitcoin/src/protocol.cpp 8faeddc8ca1b84e53edee8f3325edd7db8b74e063f4d338ae7e280c02dce96e8156157a6802feab5b7f695981e6f8a42ab5f44b9df3093a4d7c4f30f9b029912
+++ b/bitcoin/src/protocol.cpp 35effbc7f73cdbda92148be58171b2337c090a7997eb3b02daf9a88287b4315c80d7fa5edf403be9cf958969c0c7e0c1b578c10f146ee0ea9b2965a1f97971bf
@@ -9,8 +9,8 @@
// Prototypes from net.h, but that header (currently) stinks, can't #include it without breaking things
-bool Lookup(const char *pszName, std::vector& vaddr, int nServices, int nMaxSolutions, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
-bool Lookup(const char *pszName, CAddress& addr, int nServices, bool fAllowLookup = false, int portDefault = 0, bool fAllowPort = false);
+bool Lookup(const char *pszName, std::vector& vaddr, int nServices, int nMaxSolutions, int portDefault = 0, bool fAllowPort = false);
+bool Lookup(const char *pszName, CAddress& addr, int nServices, int portDefault = 0, bool fAllowPort = false);
static const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
static const char* ppszTypeName[] =
@@ -96,28 +96,28 @@
nServices = nServicesIn;
}
-CAddress::CAddress(const char* pszIn, int portIn, bool fNameLookup, uint64 nServicesIn)
+CAddress::CAddress(const char* pszIn, int portIn, uint64 nServicesIn)
{
Init();
- Lookup(pszIn, *this, nServicesIn, fNameLookup, portIn);
+ Lookup(pszIn, *this, nServicesIn, portIn);
}
-CAddress::CAddress(const char* pszIn, bool fNameLookup, uint64 nServicesIn)
+CAddress::CAddress(const char* pszIn, uint64 nServicesIn)
{
Init();
- Lookup(pszIn, *this, nServicesIn, fNameLookup, 0, true);
+ Lookup(pszIn, *this, nServicesIn, 0, true);
}
-CAddress::CAddress(std::string strIn, int portIn, bool fNameLookup, uint64 nServicesIn)
+CAddress::CAddress(std::string strIn, int portIn, uint64 nServicesIn)
{
Init();
- Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, portIn);
+ Lookup(strIn.c_str(), *this, nServicesIn, portIn);
}
-CAddress::CAddress(std::string strIn, bool fNameLookup, uint64 nServicesIn)
+CAddress::CAddress(std::string strIn, uint64 nServicesIn)
{
Init();
- Lookup(strIn.c_str(), *this, nServicesIn, fNameLookup, 0, true);
+ Lookup(strIn.c_str(), *this, nServicesIn, 0, true);
}
void CAddress::Init()
diff -uNr a/bitcoin/src/protocol.h b/bitcoin/src/protocol.h
--- a/bitcoin/src/protocol.h eb06ffb5a1d9a725cce5c48fabf4ea4e9147aceb065acc54ae21c6d4b4065ebf5715d2dc88d3934312517a15247ff689711ede12328f5b8deadb6e2b43253c35
+++ b/bitcoin/src/protocol.h 788e0529775e119dbca114dd28e76b8b83ceef9870e140edd9140e8fbe61bba1213f174708a2cc8e3ceb8c839a40f8fde98a419e07c3a0fe37979e6109e4ec61
@@ -67,10 +67,10 @@
CAddress();
CAddress(unsigned int ipIn, unsigned short portIn=0, uint64 nServicesIn=NODE_NETWORK);
explicit CAddress(const struct sockaddr_in& sockaddr, uint64 nServicesIn=NODE_NETWORK);
- explicit CAddress(const char* pszIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
- explicit CAddress(const char* pszIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
- explicit CAddress(std::string strIn, int portIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
- explicit CAddress(std::string strIn, bool fNameLookup = false, uint64 nServicesIn=NODE_NETWORK);
+ explicit CAddress(const char* pszIn, int portIn, uint64 nServicesIn=NODE_NETWORK);
+ explicit CAddress(const char* pszIn, uint64 nServicesIn=NODE_NETWORK);
+ explicit CAddress(std::string strIn, int portIn, uint64 nServicesIn=NODE_NETWORK);
+ explicit CAddress(std::string strIn, uint64 nServicesIn=NODE_NETWORK);
void Init();