Post
Topic
Board Development & Technical Discussion
Re: Need Math for Halving Interval and Subsidy
by
odolvlobo
on 06/09/2020, 01:46:12 UTC

Code:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    ...
    // Force block reward to zero when right shift is undefined.
    if (halvings >= xxx) --------------Sample
        return 0;
    ...
}

That should be the following regardless of any of the parameters:

Code:
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    ...
    // Force block reward to zero when right shift is undefined.
    if (halvings >= sizeof(nSubsidy) * CHAR_BIT;
        return 0;
    ...
}