mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 22:19:39 +01:00
net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection
This commit is contained in:
@@ -2725,15 +2725,15 @@ bool CConnman::RemoveAddedNode(const std::string& strNode)
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t CConnman::GetNodeCount(NumConnections flags)
|
||||
size_t CConnman::GetNodeCount(ConnectionDirection flags)
|
||||
{
|
||||
LOCK(cs_vNodes);
|
||||
if (flags == CConnman::CONNECTIONS_ALL) // Shortcut if we want total
|
||||
if (flags == ConnectionDirection::Both) // Shortcut if we want total
|
||||
return vNodes.size();
|
||||
|
||||
int nNum = 0;
|
||||
for (const auto& pnode : vNodes) {
|
||||
if (flags & (pnode->IsInboundConn() ? CONNECTIONS_IN : CONNECTIONS_OUT)) {
|
||||
if (flags & (pnode->IsInboundConn() ? ConnectionDirection::In : ConnectionDirection::Out)) {
|
||||
nNum++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user