setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers());
connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
- connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(updateMining()));
+
+ QTimer *timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(updateMining()));
+ timer->start(10*1000); //10 seconds
// Report errors from network/worker thread
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));
{
static uint64 nLastKernels = 0, nLastCoinDays = 0;
static float nLastKernelsRate = 0, nLastCoinDaysRate = 0;
- static unsigned int nLastTime = GetTime();
-
+ static int64 nLastTime = GetTime();
if (nKernelsTried < nLastKernels)
{
nLastTime = GetTime();
}
- unsigned int nInterval = GetTime() - nLastTime;
- if (nKernelsTried > 1000 && nInterval > 5)
+ int64 nInterval = GetTime() - nLastTime;
+ //if (nKernelsTried > 1000 && nInterval > 5)
+ if (nInterval > 10)
{
nKernelsRate = nLastKernelsRate = ( nKernelsTried - nLastKernels ) / (float) nInterval;
nCoinDaysRate = nLastCoinDaysRate = ( nCoinDaysTried - nLastCoinDays ) / (float) nInterval;