Guard null it->second

This commit is contained in:
jl777
2018-05-30 03:06:13 -11:00
parent 525c7b98a9
commit e2c2eec41a

View File

@@ -5147,7 +5147,8 @@ void static CheckBlockIndex()
// Build forward-pointing map of the entire block tree.
std::multimap<CBlockIndex*,CBlockIndex*> forward;
for (BlockMap::iterator it = mapBlockIndex.begin(); it != mapBlockIndex.end(); it++) {
forward.insert(std::make_pair(it->second->pprev, it->second));
if ( it->second != 0 )
forward.insert(std::make_pair(it->second->pprev, it->second));
}
assert(forward.size() == mapBlockIndex.size());