net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection

This commit is contained in:
Luke Dashjr
2019-10-16 17:37:19 +00:00
parent b4d22654fe
commit c77de622dd
9 changed files with 36 additions and 24 deletions

View File

@@ -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++;
}
}