--- a/trb 13dbb69420729e4daa02af705acee00bc91e31ae7948c8eccd47860207e4c7e2428bfd76997cc838b6e6469254f5d185f61772275fb092bb53b1a3738ec3af15 +++ b/trb b9ced03fd899adac8a5015e8b0f1bdc1a83500dd64b8545bc84c27ce1ab3e6cf294e7baef7c8978563d78ba03f9895983ab04eaa2146704c654fd48588ab33f6 @@ -4566,7 +4566,7 @@ #endif ############################################################################## -19150 @ ./bitcoin/src/net.h +19096 @ ./bitcoin/src/net.h ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers @@ -4596,8 +4596,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); @@ -6844,7 +6844,7 @@ #include "noui.h" ############################################################################## -4305 @ ./bitcoin/src/protocol.h +4201 @ ./bitcoin/src/protocol.h ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers @@ -6915,10 +6915,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(); @@ -15306,7 +15306,7 @@ } ############################################################################## -42984 @ ./bitcoin/src/net.cpp +42376 @ ./bitcoin/src/net.cpp ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers @@ -15339,9 +15339,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; @@ -15503,7 +15502,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) @@ -15541,33 +15540,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; @@ -16282,7 +16262,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++) @@ -16300,7 +16280,7 @@ { BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"]) { - CAddress addr(strAddr, fAllowDNS); + CAddress addr(strAddr); if (addr.IsValid()) { OpenNetworkConnection(addr); @@ -16585,7 +16565,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; @@ -16705,7 +16685,7 @@ instance_of_cnetcleanup; ############################################################################## -7874 @ ./bitcoin/src/protocol.cpp +7696 @ ./bitcoin/src/protocol.cpp ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers @@ -16718,8 +16698,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[] = @@ -16805,28 +16785,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() @@ -20561,7 +20541,7 @@ } ############################################################################## -15644 @ ./bitcoin/src/init.cpp +15469 @ ./bitcoin/src/init.cpp ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers @@ -20725,7 +20705,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") + @@ -20979,10 +20958,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: @@ -21000,7 +20977,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); @@ -23556,7 +23533,7 @@ #endif ############################################################################## -11531 @ ./bitcoin/src/irc.cpp +11409 @ ./bitcoin/src/irc.cpp ############################################################################## // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers @@ -23829,10 +23806,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)) {