This commit is contained in:
jl777
2017-03-23 19:57:18 +02:00
parent 0a0ec219d7
commit 944bf4b091

View File

@@ -367,7 +367,8 @@ void ProcessBlockAvailability(NodeId nodeid) {
if (!state->hashLastUnknownBlock.IsNull()) {
BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock);
if (itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) {
if (itOld != 0 && itOld->second != 0 && itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0)
{
if (state->pindexBestKnownBlock == NULL || itOld->second->nChainWork >= state->pindexBestKnownBlock->nChainWork)
state->pindexBestKnownBlock = itOld->second;
state->hashLastUnknownBlock.SetNull();