aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-09-02 12:25:25 -0400
committerGavin Andresen <gavinandresen@gmail.com>2011-09-02 12:25:25 -0400
commitb53e277ba12e011287d3b15823b64c303ab66243 (patch)
tree910b62216e8a32d5cc84b25669eed6ed9be2162d
parentc591cc50eb126eddc78525dd386ea98abaaed724 (diff)
downloadbitcoin-b53e277ba12e011287d3b15823b64c303ab66243.tar.xz
Stay connected to seed nodes; disconnecting causes problems if you are trying to make the initial blockchain download.
-rw-r--r--src/net.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 952102ede2..5fca17aa46 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1349,7 +1349,6 @@ void ThreadOpenConnections2(void* parg)
CRITICAL_BLOCK(cs_mapAddresses)
{
// Add seed nodes if IRC isn't working
- static bool fSeedUsed;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR) && !fTestNet)
{
@@ -1365,35 +1364,6 @@ void ThreadOpenConnections2(void* parg)
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
- fSeedUsed = true;
- }
-
- if (fSeedUsed && mapAddresses.size() > ARRAYLEN(pnSeed) + 100)
- {
- // Disconnect seed nodes
- set<unsigned int> setSeed(pnSeed, pnSeed + ARRAYLEN(pnSeed));
- static int64 nSeedDisconnected;
- if (nSeedDisconnected == 0)
- {
- nSeedDisconnected = GetTime();
- CRITICAL_BLOCK(cs_vNodes)
- BOOST_FOREACH(CNode* pnode, vNodes)
- if (setSeed.count(pnode->addr.ip))
- pnode->fDisconnect = true;
- }
-
- // Keep setting timestamps to 0 so they won't reconnect
- if (GetTime() - nSeedDisconnected < 60 * 60)
- {
- BOOST_FOREACH(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
- {
- if (setSeed.count(item.second.ip) && item.second.nTime != 0)
- {
- item.second.nTime = 0;
- CAddrDB().WriteAddress(item.second);
- }
- }
- }
}
}