MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetNodeCount

Method GetNodeCount

src/net.cpp:3846–3860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3844}
3845
3846size_t CConnman::GetNodeCount(ConnectionDirection flags) const
3847{
3848 LOCK(m_nodes_mutex);
3849 if (flags == ConnectionDirection::Both) // Shortcut if we want total
3850 return m_nodes.size();
3851
3852 int nNum = 0;
3853 for (const auto& pnode : m_nodes) {
3854 if (flags & (pnode->IsInboundConn() ? ConnectionDirection::In : ConnectionDirection::Out)) {
3855 nNum++;
3856 }
3857 }
3858
3859 return nNum;
3860}
3861
3862
3863std::map<CNetAddr, LocalServiceInfo> CConnman::getNetLocalAddresses() const

Callers 5

connman.cppFile · 0.80
getblocktemplateFunction · 0.80
getconnectioncountFunction · 0.80
getnetworkinfoFunction · 0.80
getNodeCountMethod · 0.80

Calls 2

IsInboundConnMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected