From c40fccce9ae3b744bef96a5bb05f65a0226ff159 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 6 Mar 2016 17:37:32 +0300 Subject: [PATCH] Only allow block to pass as a budget superblock if it came at or after Params().GetConsensus().nBudgetPaymentsStartBlock Closes #715 --- src/masternode-payments.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index fbd63ad99..1841434d3 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -204,7 +204,8 @@ bool IsBlockValueValid(const CBlock& block, CAmount nExpectedValue){ if(!masternodeSync.IsSynced()) { //there is no budget data to use to check anything //super blocks will always be on these blocks, max Params().GetConsensus().nBudgetPaymentsWindowBlocks per budgeting - if(nHeight % Params().GetConsensus().nBudgetPaymentsCycleBlocks < Params().GetConsensus().nBudgetPaymentsWindowBlocks){ + if(nHeight >= Params().GetConsensus().nBudgetPaymentsStartBlock && + nHeight % Params().GetConsensus().nBudgetPaymentsCycleBlocks < Params().GetConsensus().nBudgetPaymentsWindowBlocks){ return true; } else { if(block.vtx[0].GetValueOut() > nExpectedValue) return false; @@ -216,7 +217,8 @@ bool IsBlockValueValid(const CBlock& block, CAmount nExpectedValue){ return block.vtx[0].GetValueOut() <= nExpectedValue; } - if(budget.IsBudgetPaymentBlock(nHeight)){ + if(nHeight >= Params().GetConsensus().nBudgetPaymentsStartBlock && + budget.IsBudgetPaymentBlock(nHeight)){ //the value of the block is evaluated in CheckBlock return true; } else {