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?

user36303
  • 34,928
  • 2
  • 58
  • 123
mraksoll
  • 11
  • 2

1 Answers1

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 :)

user36303
  • 34,928
  • 2
  • 58
  • 123