Skip to content

Commit

Permalink
Aomori Point Release 2
Browse files Browse the repository at this point in the history
A hardfork to be back to classic cryptonight hashing algo
  • Loading branch information
Vu Quang committed May 31, 2018
1 parent cb0e722 commit a9813d6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/cryptonote_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#define CURRENT_TRANSACTION_VERSION 2
#define MIN_TRANSACTION_VERSION 2
#define CRYPTONOTE_V2_POW_BLOCK_VERSION 3
#define CRYPTONOTE_CLASSIC_POW_BLOCK_VERSION 4
#define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT 60*60*2
#define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE 10
#define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 60
Expand Down
7 changes: 5 additions & 2 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ DISABLE_VS_WARNINGS(4267)
// used to overestimate the block reward when estimating a per kB to use
#define BLOCK_REWARD_OVERESTIMATE ((uint64_t)(16000000000))
#define MAINNET_HARDFORK_V3_HEIGHT ((uint64_t)(116520))
#define MAINNET_HARDFORK_V4_HEIGHT ((uint64_t)(137500))

static const struct {
uint8_t version;
Expand All @@ -84,7 +85,8 @@ static const struct {
} mainnet_hard_forks[] = {
{ 1, 1, 0, 1482806500 },
{ 2, 21300, 0, 1497657600 },
{ 3, MAINNET_HARDFORK_V3_HEIGHT, 0, 1522800000 }
{ 3, MAINNET_HARDFORK_V3_HEIGHT, 0, 1522800000 },
{ 4, MAINNET_HARDFORK_V4_HEIGHT, 0, 1528045200 }
};
static const uint64_t mainnet_hard_fork_version_1_till = (uint64_t)-1;

Expand All @@ -96,7 +98,8 @@ static const struct {
} testnet_hard_forks[] = {
{ 1, 1, 0, 1482806500 },
{ 2, 5150, 0, 1497181713 },
{ 3, 103580, 0, 1522540800 } // April 01, 2018
{ 3, 103580, 0, 1522540800 },
{ 4, 122452, 0, 1527699600 }
};
static const uint64_t testnet_hard_fork_version_1_till = (uint64_t)-1;

Expand Down
1 change: 1 addition & 0 deletions src/cryptonote_core/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ namespace cryptonote
ADD_CHECKPOINT(75000, "b26f4e1225569da282b77659020bace52e5e89abbdee33e9e52266b1e71803a5");
ADD_CHECKPOINT(100000, "ffe474fe8353f90700c8138ddea3547d5c1e4a6facb1df85897e7a6e4daab540");
ADD_CHECKPOINT(116520, "da1cb8f30305cd5fad7d6c33b3ed88fede053e0926102d8e544b65e93e33a08b"); // v3 fork
ADD_CHECKPOINT(136240, "addf156324aa69a8c2ca2236ba3a205ab63d0d3fc23f75a57fb7c94123c578ab");
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions src/cryptonote_core/cryptonote_format_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,14 +1242,14 @@ namespace cryptonote
{
block b_local = b; //workaround to avoid const errors with do_serialize
blobdata bd = get_block_hashing_blob(b);
if(b_local.major_version < CRYPTONOTE_V2_POW_BLOCK_VERSION)
if(b_local.major_version == CRYPTONOTE_V2_POW_BLOCK_VERSION)
{
cn_pow_hash_v1 ctx_v1 = cn_pow_hash_v1::make_borrowed(ctx);
ctx_v1.hash(bd.data(), bd.size(), res.data);
ctx.hash(bd.data(), bd.size(), res.data);
}
else
{
ctx.hash(bd.data(), bd.size(), res.data);
cn_pow_hash_v1 ctx_v1 = cn_pow_hash_v1::make_borrowed(ctx);
ctx_v1.hash(bd.data(), bd.size(), res.data);
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define SUMOKOIN_VERSION_TAG "@VERSIONTAG@"
#define SUMOKOIN_VERSION "0.3.1.0"
#define SUMOKOIN_VERSION "0.3.2.0"
#define SUMOKOIN_RELEASE_NAME "Aomori"
#define SUMOKOIN_VERSION_FULL SUMOKOIN_VERSION "-" SUMOKOIN_VERSION_TAG

0 comments on commit a9813d6

Please sign in to comment.