Commit 41014578 authored by Ashot's avatar Ashot

Revert back main testnet parameters

parent 3f126066
Pipeline #944 failed with stage
in 24 minutes and 55 seconds
......@@ -11,6 +11,7 @@
#include "pow.h"
#include "tinyformat.h"
#include "uint256.h"
#include "chainparams.h"
#include <vector>
......@@ -324,8 +325,12 @@ public:
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);
READWRITE(fProofOfStake);
if (fProofOfStake) {
if (nHeight >= Params().PoSStartHeight())
{
READWRITE(fProofOfStake);
}
if (fProofOfStake)
{
READWRITE(stakeSource);
}
}
......
......@@ -155,17 +155,14 @@ static const Checkpoints::CCheckpointData data = {
static Checkpoints::MapCheckpoints mapCheckpointsTestnet =
boost::assign::map_list_of
( 0, uint256S("0x00008f72785c0713a31a5457c4169a17088338540410b548f302c92bc17c1bc1"))
( 9820, uint256S("0x000007e98d19383421f4ff13528e364edb19cda8c302df0290b2aef16936d9b2"))
( 9950, uint256S("0x000006ef1474fad5c76c503cd6896f6a09339a2c6fb66c7727566380567b1c7b"))
( 10007, uint256S("0x485e03be7d12c2802e0e49f0410011da36d0070746c48fb9bf347eff550943fa"))
( 0, uint256S("0x0000000085370d5e122f64f4ab19c68614ff3df78c8d13cb814fd7e69a1dc6da"))
;
static const Checkpoints::CCheckpointData dataTestnet = {
&mapCheckpointsTestnet,
1543018925, // * UNIX timestamp of last checkpoint block
10205, // * total number of transactions between genesis and last checkpoint
1412760826, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
2000 // * estimated number of transactions per day after checkpoint
0 // * estimated number of transactions per day after checkpoint
};
static Checkpoints::MapCheckpoints mapCheckpointsDevnet =
......@@ -344,16 +341,11 @@ public:
nTargetTimespan = 2 * 24 * 60 * 60; // 2 days
nTargetSpacing = 1.5 * 60; // 1.5 minutes
nMaxTipAge = 0x7fffffff;
nBlockPoSStart = 10000;
nBlockPoSStart = 141000;
//! Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nTime = 1536962431;
genesis.nNonce = 1112529522;
arith_uint256 nCompact = 0;
nCompact = ~nCompact;
nCompact >>= 16;
bnProofOfWorkLimit = nCompact;
genesis.nBits = nCompact.GetCompact();
genesis.nTime = 1412760826;
genesis.nNonce = 1612467894;
// if (true && genesis.GetHash() != hashGenesisBlock)
// {
......@@ -384,7 +376,7 @@ public:
// }
hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256S("0x00008f72785c0713a31a5457c4169a17088338540410b548f302c92bc17c1bc1"));
assert(hashGenesisBlock == uint256S("0x0000000085370d5e122f64f4ab19c68614ff3df78c8d13cb814fd7e69a1dc6da"));
assert(genesis.hashMerkleRoot == uint256S("0x80ad356118a9ab8db192db66ef77146cc36d958f959251feace550e4ca3d1446"));
vFixedSeeds.clear();
......
......@@ -55,6 +55,7 @@ public:
const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; }
int GetDefaultPort() const { return nDefaultPort; }
const arith_uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; }
void SetProofOfWorkLimit(const arith_uint256& limit) { bnProofOfWorkLimit = limit; }
int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; }
/** Used to check majorities for block version upgrade */
int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; }
......
......@@ -568,8 +568,16 @@ void BitcoinMiner(CWallet *pwallet, bool fProofOfStake)
while (true) {
if (fProofOfStake) {
if (chainActive.Height() + 1 < Params().PoSStartHeight() || (!fMasterNode && !fSystemNode) ||
chainActive.Tip()->GetBlockTime() > GetAdjustedTime()) {
chainActive.Tip()->GetBlockTime() > GetAdjustedTime())
{
// 1. If the height is not reached to POS height
// 2. If it is neither a masternode nor a systemnode
// 3. If the block time is bigger then adjusted time
MilliSleep(1000);
continue;
}
else
{
//Check the state of the blockchain being synced before trying to stake
if (!masternodeSync.AreSporksSynced() || !masternodeSync.IsBlockchainSynced()) {
if (!GetBoolArg("-jumpstart", false)) {
......
......@@ -143,8 +143,17 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
if (pindexLast->nHeight + 1 >= 1059780) retarget = DIFF_DGW;
else retarget = DIFF_BTC;
if (Params().NetworkID() == CBaseChainParams::TESTNET && pindexLast->nHeight >= 10000)
if (Params().NetworkID() == CBaseChainParams::TESTNET && pindexLast->nHeight >= 140400)
{
// Use Dark Gravity Wave like in mainnet
retarget = DIFF_DGW;
}
if (Params().NetworkID() == CBaseChainParams::TESTNET && pindexLast->nHeight >= 140394)
{
// Increase testnet difficulty
Params(CBaseChainParams::TESTNET).SetProofOfWorkLimit(~arith_uint256(0) >> 14);
}
// Default Bitcoin style retargeting
if (retarget == DIFF_BTC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment