diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-03-15 18:23:51 +0100 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-03-15 18:23:51 +0100 |
| commit | c642d3224c65c993ded9423358c818b83b7d74b9 (patch) | |
| tree | 40a527285dc456c4dfe1b793fe939b723f60ea14 /src/cryptonote_basic | |
| parent | e5b5d041f5adad5e9ab7ae11816a5497d78fbcc8 (diff) | |
| parent | 3396a9f2aff1b4e3c12a663e0458934c8d42b32f (diff) | |
| download | monzero-core-c642d3224c65c993ded9423358c818b83b7d74b9.tar.gz monzero-core-c642d3224c65c993ded9423358c818b83b7d74b9.tar.xz monzero-core-c642d3224c65c993ded9423358c818b83b7d74b9.zip | |
Merge pull request #1869
3396a9f2 Add intervening v5 fork for increased min block size (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic')
| -rw-r--r-- | src/cryptonote_basic/cryptonote_basic_impl.cpp | 11 | ||||
| -rw-r--r-- | src/cryptonote_basic/cryptonote_basic_impl.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/cryptonote_basic/cryptonote_basic_impl.cpp b/src/cryptonote_basic/cryptonote_basic_impl.cpp index 243ae4059..fb9e25c00 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.cpp +++ b/src/cryptonote_basic/cryptonote_basic_impl.cpp @@ -67,6 +67,15 @@ namespace cryptonote { /* Cryptonote helper functions */ /************************************************************************/ //----------------------------------------------------------------------------------------------- + size_t get_min_block_size(uint8_t version) + { + if (version < 2) + return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1; + if (version < 5) + return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2; + return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5; + } + //----------------------------------------------------------------------------------------------- size_t get_max_block_size() { return CRYPTONOTE_MAX_BLOCK_SIZE; @@ -89,7 +98,7 @@ namespace cryptonote { base_reward = FINAL_SUBSIDY_PER_MINUTE*target_minutes; } - uint64_t full_reward_zone = version < 2 ? CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 : CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2; + uint64_t full_reward_zone = get_min_block_size(version); //make it soft if (median_size < full_reward_zone) { diff --git a/src/cryptonote_basic/cryptonote_basic_impl.h b/src/cryptonote_basic/cryptonote_basic_impl.h index 542ee6c4e..46974330b 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.h +++ b/src/cryptonote_basic/cryptonote_basic_impl.h @@ -69,6 +69,7 @@ namespace cryptonote { /************************************************************************/ /* Cryptonote helper functions */ /************************************************************************/ + size_t get_min_block_size(uint8_t version); size_t get_max_block_size(); size_t get_max_tx_size(); bool get_block_reward(size_t median_size, size_t current_block_size, uint64_t already_generated_coins, uint64_t &reward, uint8_t version); |
