1414
1515#include < QDir>
1616
17- #define REQUEST_UPDATE_MN_COUNT 0
17+ #define REQUEST_UPDATE_COUNTS 0
1818
1919SettingsInformationWidget::SettingsInformationWidget (PIVXGUI* _window,QWidget *parent) :
2020 PWidget(_window,parent),
@@ -141,6 +141,7 @@ void SettingsInformationWidget::setNumConnections(int count)
141141
142142void SettingsInformationWidget::setNumBlocks (int count)
143143{
144+ if (!isVisible ()) return ;
144145 ui->labelInfoBlockNumber ->setText (QString::number (count));
145146 if (clientModel) {
146147 ui->labelInfoBlockTime ->setText (clientModel->getLastBlockDate ().toString ());
@@ -168,7 +169,7 @@ void SettingsInformationWidget::showEvent(QShowEvent *event)
168169 if (clientModel) {
169170 clientModel->startMasternodesTimer ();
170171 // Initial masternodes count value, running in a worker thread to not lock mnmanager mutex in the main thread.
171- execute (REQUEST_UPDATE_MN_COUNT );
172+ execute (REQUEST_UPDATE_COUNTS );
172173 }
173174}
174175
@@ -181,15 +182,17 @@ void SettingsInformationWidget::hideEvent(QHideEvent *event) {
181182
182183void SettingsInformationWidget::run (int type)
183184{
184- if (type == REQUEST_UPDATE_MN_COUNT ) {
185+ if (type == REQUEST_UPDATE_COUNTS ) {
185186 QMetaObject::invokeMethod (this , " setMasternodeCount" ,
186187 Qt::QueuedConnection, Q_ARG (QString, clientModel->getMasternodesCount ()));
188+ QMetaObject::invokeMethod (this , " setNumBlocks" ,
189+ Qt::QueuedConnection, Q_ARG (int , clientModel->getLastBlockProcessedHeight ()));
187190 }
188191}
189192
190193void SettingsInformationWidget::onError (QString error, int type)
191194{
192- if (type == REQUEST_UPDATE_MN_COUNT ) {
195+ if (type == REQUEST_UPDATE_COUNTS ) {
193196 setMasternodeCount (tr (" No available data" ));
194197 }
195198}
0 commit comments