Skip to content

Commit

Permalink
PoS Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
avymantech committed Jun 3, 2018
1 parent 0a0daae commit bf8192c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
25 changes: 13 additions & 12 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ class CMainParams : public CChainParams
nMaxMoneyOut = 100000000 * COIN;

/** Height or Time Based Activations **/
nLastPOWBlock = 43201;
nLastPOWBlock = 43231;
nModifierUpdateBlock = 0;
nZerocoinStartHeight = 43202;
nZerocoinStartHeight = 43232;
nZerocoinStartTime = 1515434000; // October 17, 2017 4:30:00 AM
nBlockEnforceSerialRange = 43204; //Enforce serial range starting this block
nBlockRecalculateAccumulators = 43205; //Trigger a recalculation of accumulators
nBlockFirstFraudulent = 43203; //First block that bad serials emerged
nBlockLastGoodCheckpoint = 43205; //Last valid accumulator checkpoint
nBlockEnforceInvalidUTXO = 43201; //Start enforcing the invalid UTXO's
nBlockEnforceSerialRange = 43234; //Enforce serial range starting this block
nBlockRecalculateAccumulators = 43235; //Trigger a recalculation of accumulators
nBlockFirstFraudulent = 43233; //First block that bad serials emerged
nBlockLastGoodCheckpoint = 43235; //Last valid accumulator checkpoint
nBlockEnforceInvalidUTXO = 43231; //Start enforcing the invalid UTXO's

/**
* Build the genesis block. Note that the output of the genesis coinbase cannot
Expand Down Expand Up @@ -252,10 +252,10 @@ class CTestNetParams : public CMainParams

//! Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nTime = 1454124731;
genesis.nNonce = 2402015;
genesis.nNonce = 5709560;

hashGenesisBlock = genesis.GetHash();
//assert(hashGenesisBlock == uint256("0x0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818"));
assert(hashGenesisBlock == uint256("0x0000061884e153850c6fe281fdce02fd24c343540999ab29d942ec3ff62001e7"));

vFixedSeeds.clear();
vSeeds.clear();
Expand Down Expand Up @@ -318,11 +318,12 @@ class CRegTestParams : public CTestNetParams
bnProofOfWorkLimit = ~uint256(0) >> 1;
genesis.nTime = 1454124731;
genesis.nBits = 0x207fffff;
genesis.nNonce = 12345;
genesis.nNonce = 5709561;

hashGenesisBlock = genesis.GetHash();
nDefaultPort = 46204;
//assert(hashGenesisBlock == uint256("0x4f023a2120d9127b21bbad01724fdb79b519f593f2a85b60d3d79160ec5f29df"));

assert(hashGenesisBlock == uint256("0x0a82431131f42aa49628d91e6c98130ce44f35cf83db3e5af490e9b7b94aec67"));

vFixedSeeds.clear(); //! Testnet mode doesn't have any fixed seeds.
vSeeds.clear(); //! Testnet mode doesn't have any DNS seeds.
Expand Down Expand Up @@ -425,4 +426,4 @@ bool SelectParamsFromCommandLine()

SelectParams(network);
return true;
}
}
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

// Modify version number here!!!
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0

Expand Down
8 changes: 6 additions & 2 deletions src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
uint256 PastDifficultyAverage;
uint256 PastDifficultyAveragePrev;

if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || BlockLastSolved->nHeight < PastBlocksMin) {
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || BlockLastSolved->nHeight < PastBlocksMin) {
return Params().ProofOfWorkLimit().GetCompact();
}
}

if (pindexLast->nHeight >= 43200 && pindexLast->nHeight <= 43226) {
return Params().ProofOfWorkLimit().GetCompact();
}

if (pindexLast->nHeight > Params().LAST_POW_BLOCK()) {
uint256 bnTargetLimit = (~uint256(0) >> 24);
Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* network protocol versioning
*/

static const int PROTOCOL_VERSION = 70912;
static const int PROTOCOL_VERSION = 70913;

//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
Expand All @@ -21,8 +21,8 @@ static const int INIT_PROTO_VERSION = 209;
static const int GETHEADERS_VERSION = 70077;

//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70911;
static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70912;
static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70913;
static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70913;

//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this
Expand Down

0 comments on commit bf8192c

Please sign in to comment.