From dedcc04171679c3deaad10b88f99c72c8a9dac5d Mon Sep 17 00:00:00 2001 From: fsb4000 Date: Sat, 29 Nov 2014 19:41:27 +0600 Subject: [PATCH] =?utf8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=81=D1=82=D0=B8=D0=BA=D0=B8=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=87=D0=B0=D1=81=D1=82=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/qt/bitcoingui.cpp | 5 ++++- src/wallet.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) 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; -- 1.7.1