diff --git a/src/chainparams.cpp b/src/chainparams.cpp index eadc967617fee..0fcb9d34bf581 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -242,6 +242,7 @@ class CMainParams : public CChainParams nZerocoinRequiredStakeDepth = 200; //The required confirmations for a zpiv to be stakable nBudget_Fee_Confirmations = 6; // Number of confirmations for the finalization fee + nProposalEstablishmentTime = 60 * 60 * 24; // Proposals must be at least a day old to make it into a budget } const Checkpoints::CCheckpointData& Checkpoints() const @@ -335,6 +336,8 @@ class CTestNetParams : public CMainParams nStartMasternodePayments = 1420837558; //Fri, 09 Jan 2015 21:05:58 GMT nBudget_Fee_Confirmations = 3; // Number of confirmations for the finalization fee. We have to make this very short // here because we only have a 8 block finalization window on testnet + + nProposalEstablishmentTime = 60 * 5; // Proposals must be at least 5 mns old to make it into a test budget } const Checkpoints::CCheckpointData& Checkpoints() const { diff --git a/src/chainparams.h b/src/chainparams.h index 525598a5de75d..e317b803dbab0 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -92,6 +92,7 @@ class CChainParams int PoolMaxTransactions() const { return nPoolMaxTransactions; } /** Return the number of blocks in a budget cycle */ int GetBudgetCycleBlocks() const { return nBudgetCycleBlocks; } + int64_t GetProposalEstablishmentTime() const { return nProposalEstablishmentTime; } /** Spork key and Masternode Handling **/ std::string SporkKey() const { return strSporkKey; } @@ -190,6 +191,7 @@ class CChainParams int nZerocoinStartHeight; int nZerocoinStartTime; int nZerocoinRequiredStakeDepth; + int64_t nProposalEstablishmentTime; int nBlockEnforceSerialRange; int nBlockRecalculateAccumulators; diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 74231f884021e..502967c4807b0 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -1553,6 +1553,11 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral) return true; } +bool CBudgetProposal::IsEstablished() +{ + return nTime < GetAdjustedTime() - Params().GetProposalEstablishmentTime(); +} + bool CBudgetProposal::AddOrUpdateVote(CBudgetVote& vote, std::string& strError) { std::string strAction = "New vote inserted:"; diff --git a/src/masternode-budget.h b/src/masternode-budget.h index ce2eb227dec4c..a762c809b55ef 100644 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -492,14 +492,7 @@ class CBudgetProposal bool IsValid(std::string& strError, bool fCheckCollateral = true); - bool IsEstablished() - { - // Proposals must be at least a day old to make it into a budget - if (Params().NetworkID() == CBaseChainParams::MAIN) return (nTime < GetTime() - (60 * 60 * 24)); - - // For testing purposes - 5 minutes - return (nTime < GetTime() - (60 * 5)); - } + bool IsEstablished(); std::string GetName() { return strProposalName; } std::string GetURL() { return strURL; }