aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/cryptonote_basic_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cryptonote_basic/cryptonote_basic_impl.cpp11
1 files changed, 10 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) {