MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / GetNodeStateStats

Function GetNodeStateStats

src/main.cpp:575–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
576 NodeStatePtr state(nodeid);
577 if (state.IsNull())
578 return false;
579 stats.nMisbehavior = state->nMisbehavior;
580 stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
581 stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
582 BOOST_FOREACH(const QueuedBlock& queue, state->vBlocksInFlight) {
583 if (queue.pindex)
584 stats.vHeightInFlight.push_back(queue.pindex->nHeight);
585 }
586 return true;
587}
588
589void RegisterNodeSignals(CNodeSignals& nodeSignals)
590{

Callers 3

BOOST_FOREACHFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
refreshPeersMethod · 0.85

Calls 1

IsNullMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68