1

For what I mean, see this example in bitcoin-based coins.

We can do this:

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 = 2 * COIN;
              if(nHeight == 1)
              {
              nSubsidy = 5 * COIN;
              }
              else if (nHeight == 3339)
              {  
              nSubsidy = 10 * COIN;
              }
              else if (nHeight == 3340)
              {  
              nSubsidy = 10 * COIN;
              }
              else if (nHeight == 3341)
              {  
              nSubsidy = 20 * COIN;
              }
              else if (nHeight == 3342)
              {  
              nSubsidy = 30 * COIN;
              }
    nSubsidy >>= halvings;
    return nSubsidy;
}

But how do I do the same with Monero? I understand Monero does not use nHeight, so the same trick can't be used with Monero, correct? Or maybe I don't understand something.

I cannot find where even to change the reward setting.

On what setting is it based?

1 Answer 1

2

Monero does not use the height, but that doesn't mean a fork cannot. Just pass the block height to get_block_reward (in src/cryptonote_basic/cryptonote_basic_impl.cpp) and you're set. Don't forget to update the tests :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.