Skip to content

Commit

Permalink
GUI: Don't set a proposal's status to PASSING_NOT_FUNDED prematurely
Browse files Browse the repository at this point in the history
Simply checking that there are more "yes" votes than "no" votes isn't
enough context to determine if a proposal should be in a passing state
(`PASSING` or `PASSING_NOT_FUNDED`)
  • Loading branch information
Fuzzbawls committed Jan 10, 2022
1 parent 598ff38 commit f82a98d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qt/pivx/governancemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "budget/budgetutil.h"
#include "destination_io.h"
#include "guiconstants.h"
#include "script/standard.h"
#include "masternodeman.h"
#include "qt/transactiontablemodel.h"
#include "qt/transactionrecord.h"
#include "qt/pivx/mnmodel.h"
Expand Down Expand Up @@ -54,6 +54,7 @@ ProposalInfo GovernanceModel::buildProposalInfo(const CBudgetProposal* prop, boo
// Calculate status
int votesYes = prop->GetYeas();
int votesNo = prop->GetNays();
int mnCount = mnodeman.CountEnabled();
int remainingPayments = prop->GetRemainingPaymentCount(clientModel->getLastBlockProcessedHeight());
ProposalInfo::Status status;

Expand All @@ -65,7 +66,7 @@ ProposalInfo GovernanceModel::buildProposalInfo(const CBudgetProposal* prop, boo
status = ProposalInfo::FINISHED;
} else if (isPassing) {
status = ProposalInfo::PASSING;
} else if (votesYes > votesNo) {
} else if (votesYes - votesNo > mnCount / 10) {
status = ProposalInfo::PASSING_NOT_FUNDED;
} else {
status = ProposalInfo::NOT_PASSING;
Expand Down

0 comments on commit f82a98d

Please sign in to comment.