diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-23 17:43:53 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-10-23 17:43:53 +0000 |
commit | c891967b6fcab2e8dc4ce0c787312b36c07efa4d (patch) | |
tree | 8cf0e07b5ba8f88bfdbdb11b70722014d424767c /net.cpp | |
parent | c285051c0895b52a87b529f61256e1fda8070926 (diff) |
bugfixes from Dean Gores,
addr system changes,
make sure no gen before block 74000
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@173 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'net.cpp')
-rw-r--r-- | net.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -144,7 +144,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha } } closesocket(hSocket); - if (strLine.find("<")) + if (strLine.find("<") != -1) strLine = strLine.substr(0, strLine.find("<")); strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); while (strLine.size() > 0 && isspace(strLine[strLine.size()-1])) @@ -224,12 +224,13 @@ bool GetMyExternalIP(unsigned int& ipRet) -bool AddAddress(CAddress addr) +bool AddAddress(CAddress addr, int64 nTimePenalty) { if (!addr.IsRoutable()) return false; if (addr.ip == addrLocalHost.ip) return false; + addr.nTime = max((int64)0, (int64)addr.nTime - nTimePenalty); CRITICAL_BLOCK(cs_mapAddresses) { map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey()); @@ -1073,25 +1074,6 @@ bool OpenNetworkConnection(const CAddress& addrConnect) return false; pnode->fNetworkNode = true; - if (addrLocalHost.IsRoutable() && !fUseProxy) - { - // Advertise our address - vector<CAddress> vAddr; - vAddr.push_back(addrLocalHost); - pnode->PushMessage("addr", vAddr); - } - - // Get as many addresses as we can - pnode->PushMessage("getaddr"); - pnode->fGetAddr = true; // don't relay the results of the getaddr - - ////// should the one on the receiving end do this too? - // Subscribe our local subscription list - const unsigned int nHops = 0; - for (unsigned int nChannel = 0; nChannel < pnodeLocalHost->vfSubscribe.size(); nChannel++) - if (pnodeLocalHost->vfSubscribe[nChannel]) - pnode->PushMessage("subscribe", nChannel, nHops); - return true; } |