diff --git a/src/main.cpp b/src/main.cpp index 366f77d21..e08787d56 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -403,7 +403,7 @@ namespace { if (!state->hashLastUnknownBlock.IsNull()) { BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock); - if (itOld != mapBlockIndex.end() && itOld->second->chainPower > CChainPower()) + if (itOld != mapBlockIndex.end() && itOld->second != 0 && (itOld->second->chainPower > CChainPower())) { if (state->pindexBestKnownBlock == NULL || itOld->second->chainPower >= state->pindexBestKnownBlock->chainPower) state->pindexBestKnownBlock = itOld->second;