Skip to content

Commit

Permalink
Merge #2768: [GUI] Fix Passing Not Funded logic
Browse files Browse the repository at this point in the history
a450ea2 [GUI] Start MN update timer on launch and on governance page. (Fuzzbawls)
2ba665c [GUI] Fix Passing Not Funded logic (Fuzzbawls)

Pull request description:

  Followup to #2717 which was incorrectly marking proposals as Over Budget
   instead of Not Passing

ACKs for top commit:
  yenachar:
    ACK a450ea2

Tree-SHA512: e5d2f7da62397328987c941b4544906ad3a161d3501c825188c3723a7cd3d3366a85968e9730353a7e832a1faa46cdb3d2cef413b90cb24f7f2a639c9f66f67c
  • Loading branch information
Fuzzbawls committed Sep 25, 2022
2 parents d2a3091 + a450ea2 commit c439ec7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
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: 1 addition & 1 deletion src/qt/pivx/governancemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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 c439ec7

Please sign in to comment.