Revert depth guard
This commit is contained in:
33
src/main.cpp
33
src/main.cpp
@@ -532,28 +532,17 @@ namespace {
|
|||||||
|
|
||||||
} // anon namespace
|
} // anon namespace
|
||||||
|
|
||||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
|
||||||
{
|
LOCK(cs_main);
|
||||||
static int32_t depth;
|
CNodeState *state = State(nodeid);
|
||||||
if ( depth < 0 )
|
if (state == NULL)
|
||||||
depth = 0;
|
return false;
|
||||||
if ( depth == 0 )
|
stats.nMisbehavior = state->nMisbehavior;
|
||||||
{
|
stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
|
||||||
LOCK(cs_main);
|
stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
|
||||||
CNodeState *state = State(nodeid);
|
BOOST_FOREACH(const QueuedBlock& queue, state->vBlocksInFlight) {
|
||||||
if (state == NULL)
|
if (queue.pindex)
|
||||||
{
|
stats.vHeightInFlight.push_back(queue.pindex->nHeight);
|
||||||
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--;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user