@@ -84,6 +84,13 @@ void GovernancePage::updateProposalList()
84
84
std::vector<CBudgetProposal*> proposalsList = budget.GetAllProposals ();
85
85
std::sort (proposalsList.begin (), proposalsList.end (), sortProposalsByVotes ());
86
86
int nRow = 0 ;
87
+ CBlockIndex* pindexPrev = chainActive.Tip ();
88
+ if (!pindexPrev) return ;
89
+ int nBlockStart = pindexPrev->nHeight - pindexPrev->nHeight % Params ().GetBudgetCycleBlocks () + Params ().GetBudgetCycleBlocks ();
90
+ int nBlocksLeft = nBlockStart - pindexPrev->nHeight ;
91
+ int nBlockEnd = nBlockStart + Params ().GetBudgetCycleBlocks () - 1 ;
92
+ int mnCount = mnodeman.CountEnabled (ActiveProtocol ());
93
+
87
94
for (CBudgetProposal* pbudgetProposal : proposalsList) {
88
95
if (!pbudgetProposal->fValid ) continue ;
89
96
if (pbudgetProposal->GetRemainingPaymentCount () < 1 ) continue ;
@@ -96,8 +103,13 @@ void GovernancePage::updateProposalList()
96
103
if (std::find (allotedProposals.begin (), allotedProposals.end (), pbudgetProposal) != allotedProposals.end ()) {
97
104
nTotalAllotted += pbudgetProposal->GetAllotted ();
98
105
proposalFrame->setObjectName (QStringLiteral (" proposalFramePassing" ));
99
- } else
106
+ } else if (!pbudgetProposal->IsEstablished ()) {
107
+ proposalFrame->setObjectName (QStringLiteral (" proposalFrameNotEstablished" ));
108
+ } else if (pbudgetProposal->IsPassing (pindexPrev, nBlockStart, nBlockEnd, mnCount)) {
109
+ proposalFrame->setObjectName (QStringLiteral (" proposalFramePassingUnfunded" ));
110
+ } else {
100
111
proposalFrame->setObjectName (QStringLiteral (" proposalFrame" ));
112
+ }
101
113
proposalFrame->setFrameShape (QFrame::StyledPanel);
102
114
103
115
if (extendedProposal == pbudgetProposal)
@@ -108,20 +120,9 @@ void GovernancePage::updateProposalList()
108
120
++nRow;
109
121
}
110
122
111
- CBlockIndex* pindexPrev = chainActive.Tip ();
112
- int nNext, nLeft;
113
- if (!pindexPrev) {
114
- nNext = 0 ;
115
- nLeft = 0 ;
116
- }
117
- else {
118
- nNext = pindexPrev->nHeight - pindexPrev->nHeight % Params ().GetBudgetCycleBlocks () + Params ().GetBudgetCycleBlocks ();
119
- nLeft = nNext - pindexPrev->nHeight ;
120
- }
121
-
122
- ui->next_superblock_value ->setText (QString::number (nNext));
123
- ui->blocks_before_super_value ->setText (QString::number (nLeft));
124
- ui->time_before_super_value ->setText (QString::number (nLeft/60 /24 ));
123
+ ui->next_superblock_value ->setText (QString::number (nBlockStart));
124
+ ui->blocks_before_super_value ->setText (QString::number (nBlocksLeft));
125
+ ui->time_before_super_value ->setText (QString::number (nBlocksLeft/60 /24 ));
125
126
ui->alloted_budget_value ->setText (QString::number (nTotalAllotted/COIN));
126
127
ui->unallocated_budget_value ->setText (QString::number ((budget.GetTotalBudget (pindexPrev->nHeight ) - nTotalAllotted)/COIN));
127
128
ui->masternode_count_value ->setText (QString::number (mnodeman.stable_size ()));
0 commit comments