From 2ba665c39778d33ec34ff1464bf65222ecc6735b Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Sat, 10 Sep 2022 23:31:18 -0700 Subject: [PATCH 1/2] [GUI] Fix Passing Not Funded logic Followup to #2717 which was incorrectly marking proposals as Over Budget instead of Not Passing --- src/qt/pivx/governancemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/pivx/governancemodel.cpp b/src/qt/pivx/governancemodel.cpp index 631102a3188ba..b1084eae1bbdb 100644 --- a/src/qt/pivx/governancemodel.cpp +++ b/src/qt/pivx/governancemodel.cpp @@ -65,7 +65,7 @@ ProposalInfo GovernanceModel::buildProposalInfo(const CBudgetProposal* prop, boo status = ProposalInfo::FINISHED; } else if (isPassing) { status = ProposalInfo::PASSING; - } else if (votesYes - votesNo > mnCount / 10) { + } else if (allocatedAmount + prop->GetAmount() > getMaxAvailableBudgetAmount() && votesYes - votesNo > mnCount / 10) { status = ProposalInfo::PASSING_NOT_FUNDED; } else { status = ProposalInfo::NOT_PASSING; From a450ea2e65a12d85fcafc953762e6b871ef591f3 Mon Sep 17 00:00:00 2001 From: Fuzzbawls Date: Sat, 17 Sep 2022 00:45:59 -0700 Subject: [PATCH 2/2] [GUI] Start MN update timer on launch and on governance page. 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. --- src/qt/clientmodel.cpp | 1 + src/qt/pivx/governancewidget.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 6f1cead258cdc..0c61354528a93 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -50,6 +50,7 @@ ClientModel::ClientModel(OptionsModel* optionsModel, QObject* parent) : QObject( pollMnTimer = new QTimer(this); connect(pollMnTimer, &QTimer::timeout, this, &ClientModel::updateMnTimer); + startMasternodesTimer(); subscribeToCoreSignals(); } diff --git a/src/qt/pivx/governancewidget.cpp b/src/qt/pivx/governancewidget.cpp index 07e8eacfca69e..4e772ab26f472 100644 --- a/src/qt/pivx/governancewidget.cpp +++ b/src/qt/pivx/governancewidget.cpp @@ -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()) { @@ -281,6 +282,7 @@ void GovernanceWidget::showEvent(QShowEvent *event) void GovernanceWidget::hideEvent(QHideEvent *event) { refreshTimer->stop(); + clientModel->stopMasternodesTimer(); } void GovernanceWidget::wheelEvent(QWheelEvent* event)