| 573 | } |
| 574 | |
| 575 | bool 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 | |
| 589 | void RegisterNodeSignals(CNodeSignals& nodeSignals) |
| 590 | { |