MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetNodeCount

Method GetNodeCount

src/net.cpp:2863–2877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2861}
2862
2863size_t CConnman::GetNodeCount(ConnectionDirection flags) const
2864{
2865 LOCK(m_nodes_mutex);
2866 if (flags == ConnectionDirection::Both) // Shortcut if we want total
2867 return m_nodes.size();
2868
2869 int nNum = 0;
2870 for (const auto& pnode : m_nodes) {
2871 if (flags & (pnode->IsInboundConn() ? ConnectionDirection::In : ConnectionDirection::Out)) {
2872 nNum++;
2873 }
2874 }
2875
2876 return nNum;
2877}
2878
2879void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
2880{

Callers 5

FUZZ_TARGET_INITFunction · 0.80
getblocktemplateFunction · 0.80
getconnectioncountFunction · 0.80
getnetworkinfoFunction · 0.80
getNodeCountMethod · 0.80

Calls 2

IsInboundConnMethod · 0.80
sizeMethod · 0.45

Tested by 1

FUZZ_TARGET_INITFunction · 0.64