Advertisement
Guest User

OpenSourcecoin reward structure

a guest
Oct 14th, 2013
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.21 KB | None | 0 0
  1. int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
  2. {
  3.  
  4. static const int64 nMinimumCoin = 0.0777 * COIN;
  5.  
  6.     int64 nSubsidy = 0.0777 * COIN;                                                                         //genesis
  7.  
  8.     if (nHeight > 0 && nHeight < 7) {nSubsidy = 0 * COIN;}                                                // zero
  9.     else if (nHeight == 7) {nSubsidy = 177777 * COIN;}                                                   // Premine
  10.     else if (nHeight > 7 && nHeight < 1000) {nSubsidy = 2.5 * COIN;}                                   // IRC Launch
  11.     else if (nHeight > 1000 && nHeight < 1337) {nSubsidy = 0.0777 * COIN;}                            // low instamine official launch
  12.     else if (nHeight == 1337) {nSubsidy = 1337 * COIN;}                                               //L33T
  13.     else if (nHeight > 1337 && nHeight < 4000) {nSubsidy = 1 * COIN;}                                //final launch period
  14.     else if (nHeight > 4000 && nHeight < 8000) {nSubsidy = 22.5 * COIN;}                            // 22.5 coin
  15.     else if (nHeight > 8000 && nHeight < 16000) {nSubsidy = 15 * COIN;}                            // 15 coins per block
  16.     else if (nHeight > 16000 && nHeight < 32000) {nSubsidy = 7.5 * COIN;}                         // 7.5 coins per block
  17.     else if (nHeight > 32000 && nHeight < 64000) {nSubsidy = 6 * COIN;}                          // 6 coins per block
  18.     else if (nHeight > 64000 && nHeight < 77777) {nSubsidy = 4 * COIN;}                         // 4 coins
  19.     else if (nHeight == 77777) {nSubsidy = 10000 * COIN;}                                      // bonus reward
  20.     else if (nHeight > 77777 && nHeight < 128000) {nSubsidy = 4 * COIN;}                      // 4 coins
  21.     else if (nHeight > 128000 && nHeight < 256000) {nSubsidy = 20 * COIN;}                    // 20 coins
  22.     else if (nHeight > 256000 && nHeight < 400000) {nSubsidy = 25 * COIN;}                 // 25 coins
  23.     else if (nHeight > 2400000) {nSubsidy = 5 * COIN;}
  24.     else {nSubsidy = 1 * COIN;}              
  25.  
  26.     // Subsidy is cut in half every 400 thousand blocks
  27.     nSubsidy >>= (nHeight / 400000);
  28.  
  29.     // Minimum subsidy
  30.     if (nSubsidy < nMinimumCoin)
  31.     {
  32.         nSubsidy = nMinimumCoin;
  33.     }
  34.  
  35.     return nSubsidy + nFees;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement