diff --git a/locale/de/translation.js b/locale/de/translation.js index f23fa3d00..5a1fd4d64 100644 --- a/locale/de/translation.js +++ b/locale/de/translation.js @@ -278,6 +278,7 @@ export const de_translation = { proposalFinalisationReady: 'Bereit zum Einreichen', //Ready to submit proposalPassing: 'Bestehend', //PASSING proposalFailing: 'Scheiternd', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'Finanziert', //FUNDED proposalNotFunded: 'nicht Finanziert', //NOT FUNDED proposalPaymentsRemaining: 'Ausstehende Transaktionen
', //installment(s) remaining
of diff --git a/locale/en/translation.js b/locale/en/translation.js index cac60a256..ff4bcd415 100644 --- a/locale/en/translation.js +++ b/locale/en/translation.js @@ -275,6 +275,7 @@ export const en_translation = { proposalFinalisationReady: 'Ready to submit', proposalPassing: 'PASSING', proposalFailing: 'FAILING', + proposalTooYoung: 'TOO YOUNG', proposalFunded: 'FUNDED', proposalNotFunded: 'NOT FUNDED', proposalPaymentsRemaining: 'installment(s) remaining
of', diff --git a/locale/es-mx/translation.js b/locale/es-mx/translation.js index 5d08a748e..21b40fc59 100644 --- a/locale/es-mx/translation.js +++ b/locale/es-mx/translation.js @@ -283,6 +283,7 @@ export const es_mx_translation = { proposalFinalisationReady: 'Listo para enviarla', //Ready to submit proposalPassing: 'PASANDO', //PASSING proposalFailing: 'FRACASANDO', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'FINANCIADA', //FUNDED proposalNotFunded: 'NO FINANCIADA', //NOT FUNDED proposalPaymentsRemaining: 'plazo(s) restante(s)
de', //installment(s) remaining
of diff --git a/locale/fr/translation.js b/locale/fr/translation.js index 98c8c7e48..7ea257a61 100644 --- a/locale/fr/translation.js +++ b/locale/fr/translation.js @@ -285,6 +285,7 @@ export const fr_translation = { proposalFinalisationReady: 'Prêt à soumettre', //Ready to submit proposalPassing: 'PASSANT', //PASSING proposalFailing: 'ÉCHOUANT', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'FINANCÉE', //FUNDED proposalNotFunded: 'NON FINANCÉE', //NOT FUNDED proposalPaymentsRemaining: "l'installation(s) restants
de", //installment(s) remaining
of diff --git a/locale/it/translation.js b/locale/it/translation.js index 79664de7b..65653f8d1 100644 --- a/locale/it/translation.js +++ b/locale/it/translation.js @@ -265,6 +265,7 @@ export const it_translation = { proposalFinalisationReady: "Pronto per l'invio", //Ready to submit proposalPassing: 'Passata', //PASSING proposalFailing: 'Fallita', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'Finanziata', //FUNDED proposalNotFunded: 'Non finanziata', //NOT FUNDED proposalPaymentsRemaining: 'rata/i rimanente
di', //installment(s) remaining
of diff --git a/locale/ph/translation.js b/locale/ph/translation.js index 05cd5ac93..2a94f3d69 100644 --- a/locale/ph/translation.js +++ b/locale/ph/translation.js @@ -287,6 +287,7 @@ export const ph_translation = { proposalFinalisationReady: 'Handa ng ipasa', //Ready to submit proposalPassing: 'PASSING', //PASSING proposalFailing: 'FAILING', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'FUNDED', //FUNDED proposalNotFunded: 'NOT FUNDED', //NOT FUNDED proposalPaymentsRemaining: 'installment(s) remaining
of', //installment(s) remaining
of diff --git a/locale/pt-br/translation.js b/locale/pt-br/translation.js index 764a09df7..08a10baa1 100644 --- a/locale/pt-br/translation.js +++ b/locale/pt-br/translation.js @@ -281,6 +281,7 @@ export const pt_br_translation = { proposalFinalisationReady: 'Pronto para enviar', //Ready to submit proposalPassing: 'PASSAGEM', //PASSING proposalFailing: 'FALHA', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'FINANCIADO/A', //FUNDED proposalNotFunded: 'NÃO FINANCIADO/A', //NOT FUNDED proposalPaymentsRemaining: 'parcela(s) restante(s)
de', //installment(s) remaining
of diff --git a/locale/pt-pt/translation.js b/locale/pt-pt/translation.js index 07134d28d..9e76d7de4 100644 --- a/locale/pt-pt/translation.js +++ b/locale/pt-pt/translation.js @@ -281,6 +281,7 @@ export const pt_pt_translation = { proposalFinalisationReady: 'Pronto para enviar', //Ready to submit proposalPassing: 'PASSAGEM', //PASSING proposalFailing: 'FALHA', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: 'FINANCIADO/A', //FUNDED proposalNotFunded: 'NÃO FINANCIADO/A', //NOT FUNDED proposalPaymentsRemaining: 'parcela(s) restante(s)
de', //installment(s) remaining
of diff --git a/locale/template/translation.js b/locale/template/translation.js index 50bb960bd..a546bf9f3 100644 --- a/locale/template/translation.js +++ b/locale/template/translation.js @@ -269,6 +269,7 @@ export const translation_template = { proposalFinalisationReady: '', //Ready to submit proposalPassing: '', //PASSING proposalFailing: '', //FAILING + proposalTooYoung: '', //TOO YOUNG proposalFunded: '', //FUNDED proposalNotFunded: '', //NOT FUNDED proposalPaymentsRemaining: '', //installment(s) remaining
of diff --git a/locale/uwu/translation.js b/locale/uwu/translation.js index ca4b495af..495cf187d 100644 --- a/locale/uwu/translation.js +++ b/locale/uwu/translation.js @@ -278,6 +278,7 @@ export const uwu_translation = { proposalFinalisationReady: 'Ready tew submit', //Ready to submit proposalPassing: 'PASSING, YAY!', //PASSING proposalFailing: 'FAILING, NAY!', //FAILING + proposalTooYoung: 'TOO YOUNG, BAKA!', //TOO YOUNG proposalFunded: 'FUNDED!', //FUNDED proposalNotFunded: 'NO MONIES', //NOT FUNDED proposalPaymentsRemaining: 'payment(s) remainingz
of', //installment(s) remaining
of diff --git a/scripts/chain_params.js b/scripts/chain_params.js index 3a819b2e9..55fc752e6 100644 --- a/scripts/chain_params.js +++ b/scripts/chain_params.js @@ -46,6 +46,7 @@ export const cChainParams = { }, budgetCycleBlocks: 43200, proposalFee: 50 * COIN, + proposalFeeConfirmRequirement: 6, maxPaymentCycles: 6, maxPayment: 10 * 43200 * COIN, // 43200 blocks of 10 PIV }, @@ -74,6 +75,7 @@ export const cChainParams = { }, budgetCycleBlocks: 144, proposalFee: 50 * COIN, + proposalFeeConfirmRequirement: 3, maxPaymentCycles: 20, maxPayment: 10 * 144 * COIN, // 144 blocks of 10 tPIV }, diff --git a/scripts/global.js b/scripts/global.js index 777445bea..148ed8b05 100644 --- a/scripts/global.js +++ b/scripts/global.js @@ -2083,7 +2083,11 @@ async function waitForSubmissionBlockHeight(cProposalCache) { */ function getProposalFinalisationStatus(cPropCache) { const cNet = getNetwork(); - const nConfsLeft = cPropCache.nSubmissionHeight + 6 - cNet.cachedBlockCount; + // Confirmations left until finalisation, by network consensus + const nConfsLeft = + cPropCache.nSubmissionHeight + + cChainParams.current.proposalFeeConfirmRequirement - + cNet.cachedBlockCount; if (cPropCache.nSubmissionHeight === 0 || cNet.cachedBlockCount === 0) { return translation.proposalFinalisationConfirming; @@ -2171,6 +2175,7 @@ async function renderProposals(arrProposals, fContested) { Nays: 0, local: true, Ratio: 0, + IsEstablished: false, mpw: p, }; }) || []; @@ -2224,12 +2229,24 @@ async function renderProposals(arrProposals, fContested) { const nNetYesPercent = (nNetYes / cMasternodes.enabled) * 100; // Proposal Status calculation - const nRequiredVotes = Math.round(cMasternodes.enabled * 0.1); - const strStatus = - nNetYes >= nRequiredVotes - ? translation.proposalPassing - : translation.proposalFailing; - let strFundingStatus = translation.proposalNotFunded; + const nRequiredVotes = cMasternodes.enabled / 10; + let strStatus = ''; + let strFundingStatus = ''; + + // Proposal Status calculations + if (nNetYes < nRequiredVotes) { + // Scenario 1: Not enough votes + strStatus = translation.proposalFailing; + strFundingStatus = translation.proposalNotFunded; + } else if (!cProposal.IsEstablished) { + // Scenario 2: Enough votes, but not established + strStatus = translation.proposalFailing; + strFundingStatus = translation.proposalTooYoung; + } else { + // Scenario 3: Enough votes, and established + strStatus = translation.proposalPassing; + strFundingStatus = translation.proposalFunded; + } // Funding Status and allocation calculations if (cProposal.local) { @@ -2240,14 +2257,14 @@ async function renderProposals(arrProposals, fContested) { updateGovernanceTab ); } - const strStatus = getProposalFinalisationStatus(cPropCache); + const strLocalStatus = getProposalFinalisationStatus(cPropCache); const finalizeButton = document.createElement('button'); finalizeButton.className = 'pivx-button-small'; finalizeButton.innerHTML = ''; if ( - strStatus === translation.proposalFinalisationReady || - strStatus === translation.proposalFinalisationExpired + strLocalStatus === translation.proposalFinalisationReady || + strLocalStatus === translation.proposalFinalisationExpired ) { finalizeButton.addEventListener('click', async () => { const result = await Masternode.finalizeProposal( @@ -2320,7 +2337,7 @@ async function renderProposals(arrProposals, fContested) { domStatus.innerHTML = ` - ${strStatus}
+ ${strLocalStatus}
@@ -2329,6 +2346,7 @@ async function renderProposals(arrProposals, fContested) { } else { if (domTable.id == 'proposalsTableBody') { if ( + cProposal.IsEstablished && nNetYes >= nRequiredVotes && totalAllocatedAmount + cProposal.MonthlyPayment <= cChainParams.current.maxPayment / COIN