Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syncing issues #1

Merged
merged 3 commits into from
Oct 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Checkpoints
( 500, uint256("0xf271b8a943dffab218f73bddd281ebce03e9b7cfc1688b39659b4a7b2490b8aa"))
( 1000, uint256("0x52ff7b14be280b1a4cc5c12d0c0a18bd95ed5964d015c11b373401ccf6b1e953"))
( 2000, uint256("0x9d06c49cde83f002131c8212a05debd8f03b0d4b80d77ea59c311ceea75308c8"))
( 7820, uint256("0x0d1e1affe64282be180e98f444ffeecf064b862a89389f334105786c837d6640"))
;

bool CheckBlock(int nHeight, const uint256& hash)
Expand Down
23 changes: 20 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,10 @@ return nSubsidy + nFees;

}

static const int64 nTargetTimespan = 60 * 2; // Exremecoin: 6 hours
static const int64 nTargetSpacing = 120; // Extremecoin: 2 minute blocks
static const int64 nInterval = nTargetTimespan / nTargetSpacing;
// Extremecoin original specifications
static int64 nTargetTimespan = 21600; // Extremecoin: 6 hours between retargets
static int64 nTargetSpacing = 300; // Extremecoin: 5 minute blocks
static int64 nInterval = nTargetTimespan / nTargetSpacing; // Extremecoin: retarget every 72 blocks

// Thanks: Balthazar for suggesting the following fix
// https://bitcointalk.org/index.php?topic=182430.msg1904506#msg1904506
Expand Down Expand Up @@ -879,6 +880,22 @@ unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBl
if (pindexLast == NULL)
return nProofOfWorkLimit;

// Extremecoin specifications as they changed with v1.2
if((pindexLast->nHeight+1) >= 7820 && (pindexLast->nHeight+1) < 14984)
{
nTargetTimespan = 120; // Extremecoin v1.2: 2 minutes between retargets
nTargetSpacing = 120; // Extremecoin v1.2: 2 minute blocks
nInterval = nTargetTimespan / nTargetSpacing; // Extremecoin v1.2: retarget every single block
}
// Extremecoin specifications which match those stated in the announce thread. Set to switch at
// block 14984 as Balthazar's scan back over 4 retarget intervals kicks in at block 15000.
else if((pindexLast->nHeight+1) >= 14984)
{
nTargetTimespan = 480; // Extremecoin v1.3: 8 minutes between retargets
nTargetSpacing = 120; // Extremecoin v1.3: 2 minute blocks
nInterval = nTargetTimespan / nTargetSpacing; // Extremecoin v1.3: retarget every 4 blocks
}

// Only change once per interval
if ((pindexLast->nHeight+1) % nInterval != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// These need to be macro's, as version.cpp's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0

Expand Down