Skip to main content
Touch up
Source Link
Murch
  • 77.8k
  • 35
  • 190
  • 641

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshiThe variables in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may createthis code snippet stand for:

  • nHeight is the number of blocks that have been found.
  • consensusParams.nSubsidyHalvingInterval is 210000 blocks, the duration of reward epochs and the interval between the halvings
  • COIN is 108, the number of satoshis in one bitcoin
  • nSubsidy finally gives the number of satoshis that may be generated per block

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

The variables in this code snippet stand for:

  • nHeight is the number of blocks that have been found.
  • consensusParams.nSubsidyHalvingInterval is 210000 blocks, the duration of reward epochs and the interval between the halvings
  • COIN is 108, the number of satoshis in one bitcoin
  • nSubsidy finally gives the number of satoshis that may be generated per block
Update link & name of file, location of source has changed. Fix source code to version 0.22 to avoid breaking in future.
Source Link

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in main.cppCAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in main.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in validation.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create

Source Link
Murch
  • 77.8k
  • 35
  • 190
  • 641

You are looking for the method CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) in main.cpp.

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

    CAmount nSubsidy = 50 * COIN;
    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= halvings;
    return nSubsidy;
}

Further explanation:
nHeight is the number of blocks that have been found.
consensusParams.nSubsidyHalvingInterval are 210000 blocks, the interval of the halvings
COIN is 10^8, the number of satoshi in one bitcoin
nSubsidy finally gives the number of satoshi that the coinbase may create