mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
Only allow block to pass as a budget superblock if it came at or after Params().GetConsensus().nBudgetPaymentsStartBlock
Closes #715
This commit is contained in:
parent
b0064145db
commit
c40fccce9a
@ -204,7 +204,8 @@ bool IsBlockValueValid(const CBlock& block, CAmount nExpectedValue){
|
|||||||
|
|
||||||
if(!masternodeSync.IsSynced()) { //there is no budget data to use to check anything
|
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
|
//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;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if(block.vtx[0].GetValueOut() > nExpectedValue) return false;
|
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;
|
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
|
//the value of the block is evaluated in CheckBlock
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user