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

Function GetNodeStateStats

src/net_processing.cpp:658–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {
659 LOCK(cs_main);
660 CNodeState *state = State(nodeid);
661 if (state == nullptr)
662 return false;
663 stats.nMisbehavior = state->nMisbehavior;
664 stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;
665 stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;
666 for (const QueuedBlock& queue : state->vBlocksInFlight) {
667 if (queue.pindex)
668 stats.vHeightInFlight.push_back(queue.pindex->nHeight);
669 }
670 return true;
671}
672
673//////////////////////////////////////////////////////////////////////////////
674//

Callers 2

getpeerinfoFunction · 0.85
getNodesStatsMethod · 0.85

Calls 2

StateClass · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected