From fb45259967032d409bca4d542b55414a7c522fba Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 2 Sep 2011 12:00:01 -0400 Subject: Do not try to download blockchain from 0.3.23 nodes --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index f68683e24b..7230906e25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1823,7 +1823,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // Ask the first connected node for block updates static int nAskedForBlocks; - if (!pfrom->fClient && (nAskedForBlocks < 1 || vNodes.size() <= 1)) + if (!pfrom->fClient && pfrom->nVersion != 32300 && (nAskedForBlocks < 1 || vNodes.size() <= 1)) { nAskedForBlocks++; pfrom->PushGetBlocks(pindexBest, uint256(0)); -- cgit v1.2.3 From c591cc50eb126eddc78525dd386ea98abaaed724 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 2 Sep 2011 12:01:42 -0400 Subject: If compiled -DDEBUG_LOCKORDER and run with -debug, print out every mutex lock/unlock (helpful for debugging something-is-holding-a-mutex-too-long problems) --- src/util.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/util.cpp b/src/util.cpp index 390b3a340b..76a2700271 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -923,16 +923,22 @@ string FormatFullVersion() struct CLockLocation { - std::string mutexName; - std::string sourceFile; - int sourceLine; - CLockLocation(const char* pszName, const char* pszFile, int nLine) { mutexName = pszName; sourceFile = pszFile; sourceLine = nLine; } + + std::string ToString() const + { + return mutexName+" "+sourceFile+":"+itostr(sourceLine); + } + +private: + std::string mutexName; + std::string sourceFile; + int sourceLine; }; typedef std::vector< std::pair > LockStack; @@ -950,14 +956,14 @@ static void potential_deadlock_detected(const std::pairsecond; + printf("Unlocked: %s\n", locklocation.ToString().c_str()); + } + dd_mutex.lock(); (*lockstack).pop_back(); + dd_mutex.unlock(); } void CCriticalSection::Enter(const char* pszName, const char* pszFile, int nLine) -- cgit v1.2.3 From b53e277ba12e011287d3b15823b64c303ab66243 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 2 Sep 2011 12:25:25 -0400 Subject: Stay connected to seed nodes; disconnecting causes problems if you are trying to make the initial blockchain download. --- src/net.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src') 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 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, CAddress)& item, mapAddresses) - { - if (setSeed.count(item.second.ip) && item.second.nTime != 0) - { - item.second.nTime = 0; - CAddrDB().WriteAddress(item.second); - } - } - } } } -- cgit v1.2.3 From ec74e8a44338202bfb82faa2cef4611cc37e7fa5 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 2 Sep 2011 12:56:10 -0400 Subject: Versions 0.3.20 THROUGH 0.3.23 have trouble with blockchain downloads; avoid them --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 7230906e25..cbcfef0411 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1823,7 +1823,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // Ask the first connected node for block updates static int nAskedForBlocks; - if (!pfrom->fClient && pfrom->nVersion != 32300 && (nAskedForBlocks < 1 || vNodes.size() <= 1)) + if (!pfrom->fClient && + (pfrom->nVersion < 32000 || pfrom->nVersion >= 32400) && + (nAskedForBlocks < 1 || vNodes.size() <= 1)) { nAskedForBlocks++; pfrom->PushGetBlocks(pindexBest, uint256(0)); -- cgit v1.2.3 From 7464e647decace52bc075d9ac8788974504e0bb9 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 2 Sep 2011 13:31:28 -0400 Subject: Bumped version numbers to 0.4.0rc1 --- src/serialize.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/serialize.h b/src/serialize.h index 0a31ff557d..698bdfe6a9 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -59,7 +59,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 32500; +static const int VERSION = 40000; static const char* pszSubVer = ""; static const bool VERSION_IS_BETA = true; -- cgit v1.2.3