From: fsb4000 Date: Sat, 29 Nov 2014 13:41:27 +0000 (+0600) Subject: обновление статистики более часто X-Git-Tag: nvc-v0.5.0~14^2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=dedcc04171679c3deaad10b88f99c72c8a9dac5d обновление статистики более часто --- diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 2f9e075..c15c567 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -420,7 +420,10 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) 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))); diff --git a/src/wallet.cpp b/src/wallet.cpp index d12e28f..f9ce658 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1630,8 +1630,7 @@ void CWallet::GetStakeStats(float &nKernelsRate, float &nCoinDaysRate) { static uint64 nLastKernels = 0, nLastCoinDays = 0; static float nLastKernelsRate = 0, nLastCoinDaysRate = 0; - static unsigned int nLastTime = GetTime(); - + static int64 nLastTime = GetTime(); if (nKernelsTried < nLastKernels) { @@ -1641,8 +1640,9 @@ void CWallet::GetStakeStats(float &nKernelsRate, float &nCoinDaysRate) 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;