diff --git a/src/Makefile.test.include b/src/Makefile.test.include index cf40f0f1abdb3..3b492868d465a 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -48,6 +48,7 @@ BITCOIN_TESTS =\ test/base32_tests.cpp \ test/base58_tests.cpp \ test/base64_tests.cpp \ + test/budget_tests.cpp \ test/checkblock_tests.cpp \ test/Checkpoints_tests.cpp \ test/coins_tests.cpp \ diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 0d921009eb38f..89e9ec69c18f1 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -939,7 +939,7 @@ CAmount CBudgetManager::GetTotalBudget(int nHeight) } else if (nHeight <= 647999 && nHeight >= 604800) { nSubsidy = 10 * COIN; } else if (nHeight >= Params().Zerocoin_Block_V2_Start()) { - nSubsidy = 6 * COIN; + nSubsidy = 10 * COIN; } else { nSubsidy = 5 * COIN; } diff --git a/src/test/budget_tests.cpp b/src/test/budget_tests.cpp new file mode 100644 index 0000000000000..c156644e2cb75 --- /dev/null +++ b/src/test/budget_tests.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2018 The PIVX developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include "masternode-budget.h" + +BOOST_AUTO_TEST_SUITE(budget_tests) + +void CheckBudgetValue(int nHeight, std::string strNetwork, CAmount nExpectedValue) +{ + CBudgetManager budget; + CAmount nBudget = budget.GetTotalBudget(nHeight); + std::string strError = strprintf("Budget is not as expected for %s. Result: %s, Expected: %s", strNetwork, FormatMoney(nBudget), FormatMoney(nExpectedValue)); + BOOST_CHECK_MESSAGE(nBudget == nExpectedValue, strError); +} + +BOOST_AUTO_TEST_CASE(budget_value) +{ + SelectParams(CBaseChainParams::MAIN); + int nHeightTest = Params().Zerocoin_Block_V2_Start() + 1; + CheckBudgetValue(nHeightTest, "mainnet", 43200*COIN); + + SelectParams(CBaseChainParams::TESTNET); + nHeightTest = Params().Zerocoin_Block_V2_Start() + 1; + CheckBudgetValue(nHeightTest, "testnet", 7300*COIN); +} + +BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/src/version.h b/src/version.h index 3bd6b32a8fe84..deb03d16c36f2 100644 --- a/src/version.h +++ b/src/version.h @@ -11,7 +11,7 @@ * network protocol versioning */ -static const int PROTOCOL_VERSION = 70913; +static const int PROTOCOL_VERSION = 70914; //! initial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; @@ -21,7 +21,7 @@ static const int GETHEADERS_VERSION = 70077; //! disconnect from peers older than this proto version static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70912; -static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70913; +static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70914; //! masternodes older than this proto version use old strMessage format for mnannounce static const int MIN_PEER_MNANNOUNCE = 70913;