Guard against set generate crash in regtest

This commit is contained in:
jl777
2018-02-22 12:00:08 +02:00
parent 6ec3d43c5c
commit 71b9e59c5a

View File

@@ -4216,7 +4216,9 @@ 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 != 0 && it->second != 0 )
forward.insert(std::make_pair(it->second->pprev, it->second));
else break;
}
assert(forward.size() == mapBlockIndex.size());