From 110696f9e17b4a42303dd6839a9cee11cd95ffb2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 20:09:55 +0200 Subject: [PATCH] Test --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 30e3ab5cb..bf57f8cb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -367,7 +367,7 @@ void ProcessBlockAvailability(NodeId nodeid) { if (!state->hashLastUnknownBlock.IsNull()) { BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock); - if (itOld->second != 0 && itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) + if (itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) { if (state->pindexBestKnownBlock == NULL || itOld->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) state->pindexBestKnownBlock = itOld->second; @@ -381,14 +381,14 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { CNodeState *state = State(nodeid); assert(state != NULL); - //ProcessBlockAvailability(nodeid); + ProcessBlockAvailability(nodeid); - /*BlockMap::iterator it = mapBlockIndex.find(hash); + BlockMap::iterator it = mapBlockIndex.find(hash); if (it != mapBlockIndex.end() && it->second->nChainWork > 0) { // An actually better block was announced. if (state->pindexBestKnownBlock == NULL || it->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) state->pindexBestKnownBlock = it->second; - } else*/ + } else { // An unknown block was announced; just assume that the latest one is the best one. state->hashLastUnknownBlock = hash;