diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 0c9281e58..22cc4fdf2 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1548,10 +1548,10 @@ void komodo_args(char *argv0) ASSETCHAINS_DECAY = GetArg("-ac_decay",0); ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0); ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey",""); - if ( ASSETCHAINS_HALVING != 0 && ASSETCHAINS_HALVING < 10000 ) + if ( ASSETCHAINS_HALVING != 0 && ASSETCHAINS_HALVING < 1440 ) { - ASSETCHAINS_HALVING = 10000; - printf("ASSETCHAINS_HALVING must be at least 10000 blocks\n"); + ASSETCHAINS_HALVING = 1440; + printf("ASSETCHAINS_HALVING must be at least 1440 blocks\n"); } if ( ASSETCHAINS_DECAY == 100000000 && ASSETCHAINS_ENDSUBSIDY == 0 ) { diff --git a/src/main.cpp b/src/main.cpp index 8d66ebe72..7f373e03b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1497,6 +1497,7 @@ extern uint64_t ASSETCHAINS_ENDSUBSIDY,ASSETCHAINS_REWARD,ASSETCHAINS_HALVING,AS CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) { + static uint64_t cached_subsidy; static int32_t cached_numhalvings; int32_t numhalvings,i; uint64_t numerator; CAmount nSubsidy = 3 * COIN; if ( ASSETCHAINS_SYMBOL[0] == 0 ) { @@ -1534,8 +1535,15 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) } else { - for (i=0; i 0 && cached_numhalvings == numhalvings ) + nSubsidy = cached_subsidy; + else + { + for (i=0; i