From 4a8518f59608773dc2dea0cee0e758d1f6219253 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sun, 20 Dec 2015 20:45:59 -0200 Subject: [PATCH] 0.9.34 quick fix to "Assertion mapInfo.count" failed, don't mess with these addrman structures! --- src/addrman.cpp | 27 +++++++-------------------- src/clientversion.h | 2 +- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/addrman.cpp b/src/addrman.cpp index c2a71db1..296e1909 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -319,26 +319,6 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen int nId; CAddrInfo *pinfo = Find(addr, &nId); - // port changed to random with twisterd >= 0.9.30 - // we must replace old port info with the newer one - if( pinfo && pinfo->GetPort() != addr.GetPort() && - pinfo->GetPort() == Params().GetDefaultPort() ) { - // remove the entry from all new buckets - for (std::vector >::iterator it = vvNew.begin(); it != vvNew.end(); it++) - { - if ((*it).erase(nId)) - pinfo->nRefCount--; - } - if (pinfo->nRefCount == 0) - { - SwapRandom(pinfo->nRandomPos, vRandom.size()-1); - vRandom.pop_back(); - mapAddr.erase(*pinfo); - mapInfo.erase(nId); - pinfo = NULL; - } - } - if (pinfo) { // periodically update nTime @@ -350,6 +330,13 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64 nTimePen // add services pinfo->nServices |= addr.nServices; + // port changed to random with twisterd >= 0.9.30 + // we must replace old port info with the newer one + if( pinfo->GetPort() != addr.GetPort() && + pinfo->GetPort() == Params().GetDefaultPort() ) { + pinfo->SetPort( addr.GetPort() ); + } + // do not update if no new information is present if (!addr.nTime || (pinfo->nTime && addr.nTime <= pinfo->nTime)) return false; diff --git a/src/clientversion.h b/src/clientversion.h index a51bc14a..41d40f4f 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -8,7 +8,7 @@ // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 -#define CLIENT_VERSION_REVISION 33 +#define CLIENT_VERSION_REVISION 34 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build