Skip to content

Commit

Permalink
hardfork difficulty retarget 5 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskii committed Jun 15, 2018
1 parent 7331e26 commit 833b520
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
9 changes: 4 additions & 5 deletions src/chainparams.cpp
Expand Up @@ -401,15 +401,14 @@ void MineGenesisBlock(CBlock &genesis)

void SetDifficultyAdjustmentParams(int nHeight)
{
if (nHeight >= 23765) {
int64_t modifiedPowTargetTimespan = 60 * 50; // 50 minutes
if (nHeight >= 17500) {
int64_t modifiedPowTargetTimespan = 60 * 60 * 12; // 12 hours
int64_t modifiedPowTargetSpacing = 10 * 60; // 10 minute

mainParams.UpdateDifficultyAdjustmentParameters(modifiedPowTargetSpacing, modifiedPowTargetTimespan);
}

if (nHeight >= 17500) {
int64_t modifiedPowTargetTimespan = 60 * 60 * 12; // 12 hours
if (nHeight >= 28400) {
int64_t modifiedPowTargetTimespan = 60 * 50; // 50 minutes
int64_t modifiedPowTargetSpacing = 10 * 60; // 10 minute

mainParams.UpdateDifficultyAdjustmentParameters(modifiedPowTargetSpacing, modifiedPowTargetTimespan);
Expand Down
14 changes: 5 additions & 9 deletions src/config/bitcoin-config.h
Expand Up @@ -18,11 +18,10 @@
#define CLIENT_VERSION_MAJOR 0

/* Minor version */

#define CLIENT_VERSION_MINOR 6
#define CLIENT_VERSION_MINOR 1

/* Build revision */
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 1

/* Copyright holder(s) before %s replacement */
#define COPYRIGHT_HOLDERS "The %s developers"
Expand Down Expand Up @@ -320,9 +319,7 @@
#define PACKAGE_NAME "Veggie"

/* Define to the full name and version of this package. */

#define PACKAGE_STRING "Veggie 0.1.6"

#define PACKAGE_STRING "Veggie 0.1.7"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "Veggie"
Expand All @@ -331,8 +328,7 @@
#define PACKAGE_URL "https://Veggie.org/"

/* Define to the version of this package. */

#define PACKAGE_VERSION "0.1.6"
#define PACKAGE_VERSION "0.1.7"

/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
Expand Down Expand Up @@ -360,7 +356,7 @@
#define USE_DBUS 1

/* Define if QR support should be compiled in */
#define USE_QRCODE 1
/* #undef USE_QRCODE */

/* UPnP support not compiled if undefined, otherwise value (0 or 1) determines
default state */
Expand Down
3 changes: 3 additions & 0 deletions src/miner.cpp
Expand Up @@ -222,6 +222,9 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
if(nHeight>=23740 && nHeight<=24100)
{
pblock->nBits = 511705087; //instamine these blocks

}else if (nHeight >= 28400 && nHeight <=28405){
pblock->nBits = 511705087; //instamine 5 blocks for difficulty changeover
}else {
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus());
}
Expand Down
2 changes: 2 additions & 0 deletions src/validation.cpp
Expand Up @@ -3020,6 +3020,8 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
}
if(nHeight == 23765)
return true; //Don't check difficulty of block 23675, difficulty fork at this block.
if((nHeight >= 28400) && (nHeight <=28405))
return true; //Difficulty changeover hardfork retarget

SetDifficultyAdjustmentParams(nHeight);
// Check proof of work
Expand Down

0 comments on commit 833b520

Please sign in to comment.