@@ -84,6 +84,13 @@ void GovernancePage::updateProposalList()
8484 std::vector<CBudgetProposal*> proposalsList = budget.GetAllProposals ();
8585 std::sort (proposalsList.begin (), proposalsList.end (), sortProposalsByVotes ());
8686 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+
8794 for (CBudgetProposal* pbudgetProposal : proposalsList) {
8895 if (!pbudgetProposal->fValid ) continue ;
8996 if (pbudgetProposal->GetRemainingPaymentCount () < 1 ) continue ;
@@ -96,8 +103,13 @@ void GovernancePage::updateProposalList()
96103 if (std::find (allotedProposals.begin (), allotedProposals.end (), pbudgetProposal) != allotedProposals.end ()) {
97104 nTotalAllotted += pbudgetProposal->GetAllotted ();
98105 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 {
100111 proposalFrame->setObjectName (QStringLiteral (" proposalFrame" ));
112+ }
101113 proposalFrame->setFrameShape (QFrame::StyledPanel);
102114
103115 if (extendedProposal == pbudgetProposal)
@@ -108,20 +120,9 @@ void GovernancePage::updateProposalList()
108120 ++nRow;
109121 }
110122
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 ));
125126 ui->alloted_budget_value ->setText (QString::number (nTotalAllotted/COIN));
126127 ui->unallocated_budget_value ->setText (QString::number ((budget.GetTotalBudget (pindexPrev->nHeight ) - nTotalAllotted)/COIN));
127128 ui->masternode_count_value ->setText (QString::number (mnodeman.stable_size ()));
0 commit comments