aboutsummaryrefslogtreecommitdiff
path: root/src/dogecoin.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-12-28 15:04:08 +0000
committerRoss Nicoll <[email protected]>2018-09-19 19:24:06 +0100
commit1be681a1b97b686f838af90682a57f2030d26015 (patch)
treeb2795e4a1d35004dbfd84d49b07bc54413a2a9e1 /src/dogecoin.cpp
parentChange BIP65/66 enforcement to match Dogecoin (#1403) (diff)
downloaddiscoin-1be681a1b97b686f838af90682a57f2030d26015.tar.xz
discoin-1be681a1b97b686f838af90682a57f2030d26015.zip
Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware * Correct implementation of simplified rewards in parameters * Correct max money * Use base block version in IsSuperMajority() instead of full version * Correct mining of blocks in AuxPoW tests * Add in missing pre-AuxPoW consensus checks
Diffstat (limited to 'src/dogecoin.cpp')
-rw-r--r--src/dogecoin.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/dogecoin.cpp b/src/dogecoin.cpp
index 76db22f94..f06849d61 100644
--- a/src/dogecoin.cpp
+++ b/src/dogecoin.cpp
@@ -37,18 +37,13 @@ bool AllowDigishieldMinDifficultyForBlock(const CBlockIndex* pindexLast, const C
unsigned int CalculateDogecoinNextWorkRequired(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params& params)
{
int nHeight = pindexLast->nHeight + 1;
- bool fNewDifficultyProtocol = (nHeight >= 145000);
- // bool fNewDifficultyProtocol = (nHeight >= params.GetDigiShieldForkBlock());
- const int64_t retargetTimespan = fNewDifficultyProtocol ? 60 // params.DigiShieldTargetTimespan()
- :
- params.nPowTargetTimespan;
-
+ const int64_t retargetTimespan = params.nPowTargetTimespan;
const int64_t nActualTimespan = pindexLast->GetBlockTime() - nFirstBlockTime;
int64_t nModulatedTimespan = nActualTimespan;
int64_t nMaxTimespan;
int64_t nMinTimespan;
- if (fNewDifficultyProtocol) //DigiShield implementation - thanks to RealSolid & WDC for this code
+ if (params.fDigishieldDifficultyCalculation) //DigiShield implementation - thanks to RealSolid & WDC for this code
{
// amplitude filter - thanks to daft27 for this code
nModulatedTimespan = retargetTimespan + (nModulatedTimespan - retargetTimespan) / 8;
@@ -84,12 +79,6 @@ unsigned int CalculateDogecoinNextWorkRequired(const CBlockIndex* pindexLast, in
if (bnNew > bnPowLimit)
bnNew = bnPowLimit;
- /// debug print
- LogPrintf("GetNextWorkRequired RETARGET\n");
- LogPrintf("params.nPowTargetTimespan = %d nActualTimespan = %d\n", params.nPowTargetTimespan, nActualTimespan);
- LogPrintf("Before: %08x %s\n", pindexLast->nBits, bnOld.ToString());
- LogPrintf("After: %08x %s\n", bnNew.GetCompact(), bnNew.ToString());
-
return bnNew.GetCompact();
}
@@ -134,7 +123,7 @@ CAmount GetDogecoinBlockSubsidy(int nHeight, const Consensus::Params& consensusP
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
- if (nHeight < 145000) // && !consensusParams.SimplifiedRewards())
+ if (!consensusParams.fSimplifiedRewards)
{
// Old-style rewards derived from the previous block hash
const std::string cseed_str = prevHash.ToString().substr(7, 7);