Add superblock checks in various places
This commit is contained in:
parent
18635f0979
commit
e0031a807e
@ -232,6 +232,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight)
|
||||
}
|
||||
|
||||
//check if it's a budget block
|
||||
if(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS)){
|
||||
if(budget.IsBudgetPaymentBlock(nBlockHeight)){
|
||||
if(budget.IsTransactionValid(txNew, nBlockHeight)){
|
||||
return true;
|
||||
@ -245,6 +246,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check for masternode payee
|
||||
if(masternodePayments.IsTransactionValid(txNew, nBlockHeight))
|
||||
@ -269,7 +271,7 @@ void FillBlockPayee(CMutableTransaction& txNew, int64_t nFees)
|
||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||
if(!pindexPrev) return;
|
||||
|
||||
if(budget.IsBudgetPaymentBlock(pindexPrev->nHeight+1)){
|
||||
if(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(pindexPrev->nHeight+1)){
|
||||
budget.FillBlockPayee(txNew, nFees);
|
||||
} else {
|
||||
masternodePayments.FillBlockPayee(txNew, nFees);
|
||||
@ -278,7 +280,7 @@ void FillBlockPayee(CMutableTransaction& txNew, int64_t nFees)
|
||||
|
||||
std::string GetRequiredPaymentsString(int nBlockHeight)
|
||||
{
|
||||
if(budget.IsBudgetPaymentBlock(nBlockHeight)){
|
||||
if(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(nBlockHeight)){
|
||||
return budget.GetRequiredPaymentsString(nBlockHeight);
|
||||
} else {
|
||||
return masternodePayments.GetRequiredPaymentsString(nBlockHeight);
|
||||
|
@ -49,8 +49,8 @@ Value mnbudget(const Array& params, bool fHelp)
|
||||
std::vector<CMasternodeConfig::CMasternodeEntry> mnEntries;
|
||||
mnEntries = masternodeConfig.getEntries();
|
||||
|
||||
if (params.size() != 7 && params.size() != 8)
|
||||
throw runtime_error("Correct usage is 'mnbudget prepare proposal-name url payment_count block_start dash_address monthly_payment_dash [use_ix(true|false)]'");
|
||||
if (params.size() != 7)
|
||||
throw runtime_error("Correct usage is 'mnbudget prepare proposal-name url payment_count block_start dash_address monthly_payment_dash'");
|
||||
|
||||
std::string strProposalName = params[1].get_str();
|
||||
if(strProposalName.size() > 20)
|
||||
|
Loading…
Reference in New Issue
Block a user