Skip to content

Commit

Permalink
Fix problem in calculating max_money when there is no halving
Browse files Browse the repository at this point in the history
  • Loading branch information
miketout committed Nov 19, 2018
1 parent c17f353 commit e12645a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/komodo_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ int64_t komodo_current_supply(uint32_t nHeight)
uint32_t modulo = (curEnd - lastEnd) % period;
uint64_t decay = ASSETCHAINS_DECAY[j];

if (!period)
{
// no halving, straight multiply
cur_money += reward * (nHeight - 1);
}
// if exactly SATOSHIDEN, linear decay to zero or to next era, same as:
// (next_era_reward + (starting reward - next_era_reward) / 2) * num_blocks
if ( decay == SATOSHIDEN )
else if ( decay == SATOSHIDEN )
{
int64_t lowestSubsidy, subsidyDifference, stepDifference, stepTriangle;
int64_t denominator, modulo;
Expand Down

0 comments on commit e12645a

Please sign in to comment.