[Qt] show number of in/out connections in debug console

This commit is contained in:
Philip Kaufmann
2014-02-16 19:48:27 +01:00
parent aefbf6e30c
commit 8e29623077
3 changed files with 28 additions and 4 deletions

View File

@@ -39,9 +39,18 @@ ClientModel::~ClientModel()
unsubscribeFromCoreSignals();
}
int ClientModel::getNumConnections() const
int ClientModel::getNumConnections(unsigned int flags) const
{
return vNodes.size();
LOCK(cs_vNodes);
if (flags == CONNECTIONS_ALL) // Shortcut if we want total
return vNodes.size();
int nNum = 0;
BOOST_FOREACH(CNode* pnode, vNodes)
if (flags & (pnode->fInbound ? CONNECTIONS_IN : CONNECTIONS_OUT))
nNum++;
return nNum;
}
int ClientModel::getNumBlocks() const