#include <QDateTime>
#include <QTimer>
+extern double GetPoSKernelPS();
+extern double GetDifficulty(const CBlockIndex* blockindex);
+
static const int64 nClientStartupTime = GetTime();
ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) :
unsubscribeFromCoreSignals();
}
+double ClientModel::getPoSKernelPS()
+{
+ return GetPoSKernelPS();
+}
+
+double ClientModel::getDifficulty(bool fProofofStake)
+{
+ if (fProofofStake)
+ return GetDifficulty(GetLastBlockIndex(pindexBest,true));
+ else
+ return GetDifficulty(GetLastBlockIndex(pindexBest,false));
+}
+
int ClientModel::getNumConnections() const
{
return vNodes.size();
QDateTime ClientModel::getLastBlockDate() const
{
- return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ if (pindexBest)
+ return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ else
+ return QDateTime::fromTime_t(1360105017); // Genesis block's time
}
void ClientModel::updateTimer()