From 832134f4cd4a564d7e438478335a512ba8380a37 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Mon, 5 Aug 2019 13:16:13 -0600 Subject: [PATCH] Update PoW related assertions --- src/chainparams.cpp | 1 - src/consensus/params.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 82d60af31..f85786be7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -509,7 +509,6 @@ public: void UpdateRegtestPow(int64_t nPowMaxAdjustDown, int64_t nPowMaxAdjustUp, uint256 powLimit) { - assert(strNetworkID == "regtest"); consensus.nPowMaxAdjustDown = nPowMaxAdjustDown; consensus.nPowMaxAdjustUp = nPowMaxAdjustUp; consensus.powLimit = powLimit; diff --git a/src/consensus/params.h b/src/consensus/params.h index 8644b087f..5599d6cbe 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -68,6 +68,7 @@ static_assert(POST_BLOSSOM_POW_TARGET_SPACING < PRE_BLOSSOM_POW_TARGET_SPACING, static const unsigned int PRE_BLOSSOM_HALVING_INTERVAL = 840000; static const unsigned int PRE_BLOSSOM_REGTEST_HALVING_INTERVAL = 150; static const int BLOSSOM_POW_TARGET_SPACING_RATIO = PRE_BLOSSOM_POW_TARGET_SPACING / POST_BLOSSOM_POW_TARGET_SPACING; +static_assert(BLOSSOM_POW_TARGET_SPACING_RATIO * POST_BLOSSOM_POW_TARGET_SPACING == PRE_BLOSSOM_POW_TARGET_SPACING, "Invalid BLOSSOM_POW_TARGET_SPACING_RATIO"); static const unsigned int POST_BLOSSOM_HALVING_INTERVAL = PRE_BLOSSOM_HALVING_INTERVAL * BLOSSOM_POW_TARGET_SPACING_RATIO; static const unsigned int POST_BLOSSOM_REGTEST_HALVING_INTERVAL = PRE_BLOSSOM_REGTEST_HALVING_INTERVAL * BLOSSOM_POW_TARGET_SPACING_RATIO;