Revert depth guard
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -532,20 +532,11 @@ namespace {
|
|||||||
|
|
||||||
} // anon namespace
|
} // anon namespace
|
||||||
|
|
||||||
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
|
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
|
||||||
{
|
|
||||||
static int32_t depth;
|
|
||||||
if ( depth < 0 )
|
|
||||||
depth = 0;
|
|
||||||
if ( depth == 0 )
|
|
||||||
{
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
CNodeState *state = State(nodeid);
|
CNodeState *state = State(nodeid);
|
||||||
if (state == NULL)
|
if (state == NULL)
|
||||||
{
|
|
||||||
depth--;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
stats.nMisbehavior = state->nMisbehavior;
|
stats.nMisbehavior = state->nMisbehavior;
|
||||||
stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
|
stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
|
||||||
stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
|
stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
|
||||||
@@ -553,8 +544,6 @@ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
|
|||||||
if (queue.pindex)
|
if (queue.pindex)
|
||||||
stats.vHeightInFlight.push_back(queue.pindex->nHeight);
|
stats.vHeightInFlight.push_back(queue.pindex->nHeight);
|
||||||
}
|
}
|
||||||
depth--;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user