diff --git a/configure.ac b/configure.ac index 3b7c59d10..5dccd0bba 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 1) define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 19) +define(_CLIENT_VERSION_REVISION, 20) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 5dd6cff2d..9f322d9df 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -106,6 +106,7 @@ class CMainParams : public CChainParams { consensus.nTPoSContractSignatureDeploymentTime = 1523127600; consensus.nPowKGWHeight = 15200; consensus.nPowDGWHeight = 24; + consensus.nMaxBlockSpacingFixDeploymentHeight = 674980; // apprx 28 of June consensus.fPowAllowMinDifficultyBlocks = false; consensus.fPowNoRetargeting = false; consensus.nRuleChangeActivationThreshold = 1080; // 75% of 2016 @@ -235,6 +236,7 @@ class CTestNetParams : public CChainParams { consensus.fPowNoRetargeting = false; consensus.nPowKGWHeight = 4001; // nPowKGWHeight >= nPowDGWHeight means "no KGW" consensus.nPowDGWHeight = 4001; + consensus.nMaxBlockSpacingFixDeploymentHeight = 0; consensus.nStakeMinAge = 60 * 60; consensus.nStakeMaxAge = 60 * 60 * 24; // one day consensus.nCoinbaseMaturity = 20; @@ -362,6 +364,7 @@ class CRegTestParams : public CChainParams { consensus.nPowKGWHeight = 4001; // nPowKGWHeight >= nPowDGWHeight means "no KGW" consensus.nPowDGWHeight = 4001; consensus.nLastPoWBlock = 75; + consensus.nMaxBlockSpacingFixDeploymentHeight = 0; consensus.nStakeMinAge = 60 * 60; consensus.nStakeMaxAge = 60 * 60 * 24; // one day consensus.nCoinbaseMaturity = 20; diff --git a/src/consensus/params.h b/src/consensus/params.h index aaf59f81f..c9700a45c 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -99,6 +99,7 @@ struct Params { int nStakeMaxAge; int nCoinbaseMaturity; int nTPoSContractSignatureDeploymentTime; + int nMaxBlockSpacingFixDeploymentHeight; }; } // namespace Consensus diff --git a/src/pow.cpp b/src/pow.cpp index 4f80275a8..0debc9453 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -90,6 +90,11 @@ unsigned int static PoSWorkRequired(const CBlockIndex* pindexLast, const Consens if (nActualSpacing < 0) nActualSpacing = 1; + if(pindexLast->nHeight > params.nMaxBlockSpacingFixDeploymentHeight) + { + nActualSpacing = std::min(nActualSpacing, nTargetSpacing * 10); + } + // ppcoin: target change every block // ppcoin: retarget with exponential moving toward target spacing arith_uint256 bnNew; diff --git a/src/tpos/merchantnodeman.cpp b/src/tpos/merchantnodeman.cpp index 6dc35c900..b845fd53c 100644 --- a/src/tpos/merchantnodeman.cpp +++ b/src/tpos/merchantnodeman.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include /** Merchantnode manager */ @@ -354,7 +355,7 @@ void CMerchantnodeMan::DsegUpdate(CNode* pnode, CConnman& connman) int64_t askAgain = GetTime() + DSEG_UPDATE_SECONDS; mWeAskedForMerchantnodeList[pnode->addr] = askAgain; - LogPrint(BCLog::MERCHANTNODE, "CMerchantnodeMan::DsegUpdate -- asked %s for the list\n", pnode->addr.ToString()); + LogPrintf("CMerchantnodeMan::DsegUpdate -- asked %s for the list\n", pnode->addr.ToString()); } CMerchantnode* CMerchantnodeMan::Find(const CPubKey &pubKeyMerchantnode) @@ -732,7 +733,11 @@ void CMerchantnodeMan::AskForMissing(CConnman &connman) for(auto &&it : mUnknownMerchantnodes) { - shouldAsk |= (it.second >= 10); + if(it.second >= 10) + { + shouldAsk = true; + LogPrintf("Asking for merchantnode with address: %s\n", EncodeDestination(it.first)); + } } if(shouldAsk)