From 47538c0995747c5a03f5484205b68d48df31982b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 11 Nov 2018 05:27:38 -1100 Subject: [PATCH] Revert depth guard --- src/main.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bc371e4eb..64d48d7ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -532,28 +532,17 @@ namespace { } // anon namespace -bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) -{ - static int32_t depth; - if ( depth < 0 ) - depth = 0; - if ( depth == 0 ) - { - LOCK(cs_main); - CNodeState *state = State(nodeid); - if (state == NULL) - { - depth--; - return false; - } - stats.nMisbehavior = state->nMisbehavior; - stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1; - stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1; - BOOST_FOREACH(const QueuedBlock& queue, state->vBlocksInFlight) { - if (queue.pindex) - stats.vHeightInFlight.push_back(queue.pindex->nHeight); - } - depth--; +bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) { + LOCK(cs_main); + CNodeState *state = State(nodeid); + if (state == NULL) + return false; + stats.nMisbehavior = state->nMisbehavior; + stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1; + stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1; + BOOST_FOREACH(const QueuedBlock& queue, state->vBlocksInFlight) { + if (queue.pindex) + stats.vHeightInFlight.push_back(queue.pindex->nHeight); } return true; }