Test
This commit is contained in:
@@ -1548,10 +1548,10 @@ void komodo_args(char *argv0)
|
|||||||
ASSETCHAINS_DECAY = GetArg("-ac_decay",0);
|
ASSETCHAINS_DECAY = GetArg("-ac_decay",0);
|
||||||
ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0);
|
ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0);
|
||||||
ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey","");
|
ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey","");
|
||||||
if ( ASSETCHAINS_HALVING != 0 && ASSETCHAINS_HALVING < 10000 )
|
if ( ASSETCHAINS_HALVING != 0 && ASSETCHAINS_HALVING < 1440 )
|
||||||
{
|
{
|
||||||
ASSETCHAINS_HALVING = 10000;
|
ASSETCHAINS_HALVING = 1440;
|
||||||
printf("ASSETCHAINS_HALVING must be at least 10000 blocks\n");
|
printf("ASSETCHAINS_HALVING must be at least 1440 blocks\n");
|
||||||
}
|
}
|
||||||
if ( ASSETCHAINS_DECAY == 100000000 && ASSETCHAINS_ENDSUBSIDY == 0 )
|
if ( ASSETCHAINS_DECAY == 100000000 && ASSETCHAINS_ENDSUBSIDY == 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
12
src/main.cpp
12
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)
|
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;
|
int32_t numhalvings,i; uint64_t numerator; CAmount nSubsidy = 3 * COIN;
|
||||||
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||||
{
|
{
|
||||||
@@ -1534,8 +1535,15 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=0; i<numhalvings&&nSubsidy!=0; i++)
|
if ( cached_subsidy > 0 && cached_numhalvings == numhalvings )
|
||||||
nSubsidy = (nSubsidy * ASSETCHAINS_DECAY) / 100000000;
|
nSubsidy = cached_subsidy;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i=0; i<numhalvings&&nSubsidy!=0; i++)
|
||||||
|
nSubsidy = (nSubsidy * ASSETCHAINS_DECAY) / 100000000;
|
||||||
|
cached_subsidy = nSubsidy;
|
||||||
|
cached_numhalvings = numhalvings;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user