Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | X(nStartingHeight); | ||||
X(nSendBytes); | X(nSendBytes); | ||||
} | } | ||||
{ | { | ||||
LOCK(cs_vRecv); | LOCK(cs_vRecv); | ||||
X(mapRecvBytesPerMsgCmd); | X(mapRecvBytesPerMsgCmd); | ||||
X(nRecvBytes); | X(nRecvBytes); | ||||
} | } | ||||
X(fWhitelisted); | X(fWhitelisted); | ||||
X(fUsesCashMagic); | |||||
// It is common for nodes with good ping times to suddenly become lagged, | // It is common for nodes with good ping times to suddenly become lagged, | ||||
// due to a new block arriving or other large transfer. Merely reporting | // due to a new block arriving or other large transfer. Merely reporting | ||||
// pingtime might fool the caller into thinking the node was still | // pingtime might fool the caller into thinking the node was still | ||||
// responsive, since pingtime does not update until the ping is complete, | // responsive, since pingtime does not update until the ping is complete, | ||||
// which might take a while. So, if a ping is taking an unusually long time | // which might take a while. So, if a ping is taking an unusually long time | ||||
// in flight, the caller can immediately detect that this is happening. | // in flight, the caller can immediately detect that this is happening. | ||||
int64_t nPingUsecWait = 0; | int64_t nPingUsecWait = 0; | ||||
▲ Show 20 Lines • Show All 1,961 Lines • ▼ Show 20 Lines | size_t CConnman::GetNodeCount(NumConnections flags) { | ||||
return nNum; | return nNum; | ||||
} | } | ||||
void CConnman::GetNodeStats(std::vector<CNodeStats> &vstats) { | void CConnman::GetNodeStats(std::vector<CNodeStats> &vstats) { | ||||
vstats.clear(); | vstats.clear(); | ||||
LOCK(cs_vNodes); | LOCK(cs_vNodes); | ||||
vstats.reserve(vNodes.size()); | vstats.reserve(vNodes.size()); | ||||
for (std::vector<CNode *>::iterator it = vNodes.begin(); it != vNodes.end(); | for (CNode *pnode : vNodes) { | ||||
++it) { | |||||
CNode *pnode = *it; | |||||
vstats.emplace_back(); | vstats.emplace_back(); | ||||
pnode->copyStats(vstats.back()); | pnode->copyStats(vstats.back()); | ||||
} | } | ||||
} | } | ||||
bool CConnman::DisconnectNode(const std::string &strNode) { | bool CConnman::DisconnectNode(const std::string &strNode) { | ||||
LOCK(cs_vNodes); | LOCK(cs_vNodes); | ||||
if (CNode *pnode = FindNode(strNode)) { | if (CNode *pnode = FindNode(strNode)) { | ||||
▲ Show 20 Lines • Show All 397 Lines • Show Last 20 Lines |