extern double GetPoSKernelPS();
extern double GetDifficulty(const CBlockIndex* blockindex);
-static const int64 nClientStartupTime = GetTime();
+static const int64_t nClientStartupTime = GetTime();
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
QObject(parent), optionsModel(optionsModel),
return GetDifficulty(GetLastBlockIndex(pindexBest,false));
}
-int ClientModel::getNumConnections() const
+int ClientModel::getNumConnections(uint8_t flags) const
{
- return vNodes.size();
+ LOCK(cs_vNodes);
+ if (flags == CONNECTIONS_ALL) // Shortcut if we want total
+ return (int)(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