Skip to content

Commit

Permalink
[GUI] Start MN update timer on launch and on governance page.
Browse files Browse the repository at this point in the history
Determining if a proposal is over budget requires an accurate count of
the number of MNs active on the network. To get this, start the MN
update timer on launch as well as when activating the DAO page.
  • Loading branch information
Fuzzbawls committed Sep 17, 2022
1 parent 2ba665c commit a450ea2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ClientModel::ClientModel(OptionsModel* optionsModel, QObject* parent) : QObject(

pollMnTimer = new QTimer(this);
connect(pollMnTimer, &QTimer::timeout, this, &ClientModel::updateMnTimer);
startMasternodesTimer();

subscribeToCoreSignals();
}
Expand Down
2 changes: 2 additions & 0 deletions src/qt/pivx/governancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ void GovernanceWidget::loadWalletModel()

void GovernanceWidget::showEvent(QShowEvent *event)
{
clientModel->startMasternodesTimer();
tryGridRefresh(true); // future: move to background worker
if (!refreshTimer) refreshTimer = new QTimer(this);
if (!refreshTimer->isActive()) {
Expand All @@ -281,6 +282,7 @@ void GovernanceWidget::showEvent(QShowEvent *event)
void GovernanceWidget::hideEvent(QHideEvent *event)
{
refreshTimer->stop();
clientModel->stopMasternodesTimer();
}

void GovernanceWidget::wheelEvent(QWheelEvent* event)
Expand Down

0 comments on commit a450ea2

Please sign in to comment.