This commit is contained in:
jl777
2016-11-19 18:07:04 -03:00
parent 055db9b60e
commit 43450135b5
2 changed files with 12 additions and 9 deletions

View File

@@ -535,10 +535,10 @@ CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& loc
// Find the first block the caller has in the main chain
BOOST_FOREACH(const uint256& hash, locator.vHave) {
BlockMap::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
if (mi != 0 && mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
if (chain.Contains(pindex))
if (pindex != 0 && chain.Contains(pindex))
return pindex;
}
}