Advertisement
Guest User

Mjollnircoin upcoming Vault Blocks

a guest
Jun 14th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.01 KB | None | 0 0
  1. diff --git a/src/main.cpp b/src/main.cpp
  2. index acc6134..41d0220 100644
  3. --- a/src/main.cpp
  4. +++ b/src/main.cpp
  5. @@ -1091,9 +1091,60 @@ inline int64_t GetDevaluatedBlock( float rate, int nCycle )
  6.     return (int64_t) ( base * COIN );
  7.  }
  8.  
  9. +/* Use lower block interval and block starting offset (VAULT_BLOCK_1) on testnet */
  10. +#define VAULT_BLOCK_REWARD 25000
  11. +#define VAULT_BLOCK_INTERVAL 5152
  12. +#define VAULT_BLOCK_1 37712
  13. +#define NUM_VAULT_BLOCKS 10
  14. +
  15. +/*
  16. +https://bitcointalk.org/index.php?topic=577437.msg7295018#msg7295018
  17. +
  18. +"Vault blocks": blocks with a high reward that are immediateley payed to the Mjollnircoin Vault when mined. Once the block is payed to the Vault, it will be auctioned and the highest bidder wins the vaulted block which is then payed out to the winner either directly or through an Escrow Service. The assumption here is, that when Mjollnircoin hits the Bittrex Exchange the value goes go up (which would then not be a bad investment)
  19. +
  20. +The reward of such a vaulted block should be high enough to make it worthwhile and the starting bid should be such that we only need a scarse number of
  21. +these blocks (perhaps as few as 10, with a reward of 25000 MNR for example).
  22. +
  23. +Also see function CreateNewBlock
  24. +
  25. +*/
  26. +
  27. +/*
  28. +Mjollnircoin [testnet] Public Key:      04ae281bb5684205f7b8bde7ae173c9db6050945d4cd28e09d600a94de4e2102835edc3561de20a2058c8ab7041de9375d60395999b517642b7aaed618f08338e9
  29. +Mjollnircoin [testnet] Address:         nTe5gRgdjkJJ9zd2hfrQdamiMXGpyiPGNo
  30. +*/
  31. +
  32. +#define MNR_VAULT_PUBKEY_TESTNET  "04ae281bb5684205f7b8bde7ae173c9db6050945d4cd28e09d600a94de4e2102835edc3561de20a2058c8ab7041de9375d60395999b517642b7aaed618f08338e9"
  33. +#define MNR_VAULT_PUBKEY_PRODNET  "0427f6049984f779586b9a2835714b79bf4284111cd5248b30b408087ae375bd45918fb4b14325a494208932e8d41c02cf1e3327a5b8077993b35e397eaab674c7"
  34. +
  35. +inline int64_t GetVaultBlockValue( )
  36. +{
  37. +   return (int64_t) ( VAULT_BLOCK_REWARD * COIN );
  38. +}
  39. +
  40. +bool  static isVaultBlock(int nHeight)
  41. +{
  42. +   if( nHeight == VAULT_BLOCK_1 )
  43. +       return true;
  44. +  
  45. +   for( int i = 1; i < NUM_VAULT_BLOCKS; i ++ ) {
  46. +       if( nHeight == ((i * VAULT_BLOCK_INTERVAL) + VAULT_BLOCK_1))
  47. +           return true;
  48. +   }
  49. +   return false;
  50. +}
  51. +/* end of vault blocks */
  52. +
  53.  int64 static GetBlockValue(int nHeight, int64 nFees)
  54.  {
  55.     int64 nSubsidy = 0;
  56. +
  57. +   /* deploy in testnet */
  58. +   if( fTestNet && isVaultBlock( nHeight ) ) {
  59. +       nSubsidy = GetVaultBlockValue();
  60. +       return (nSubsidy + nFees);
  61. +   }
  62. +
  63.     if( nHeight < 1000 ) {
  64.         nSubsidy = 125  * COIN;
  65.     }
  66. @@ -4682,9 +4733,20 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
  67.          nLastBlockSize = nBlockSize;
  68.          printf("CreateNewBlock(): total size %"PRI64u"\n", nBlockSize);
  69.  
  70. -        pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
  71. -        pblocktemplate->vTxFees[0] = -nFees;
  72. -
  73. +   if( fTestNet && isVaultBlock( pindexPrev->nHeight + 1 ) ) {
  74. +       pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
  75. +       pblock->vtx[0].vout[0].scriptPubKey = CScript() << ParseHex( (fTestNet ? MNR_VAULT_PUBKEY_TESTNET : MNR_VAULT_PUBKEY_PRODNET)) << OP_CHECKSIG;
  76. +       printf("CreateNewBlock(): %d MNR Vault Block discovered! This block will be auctioned at https://bitcointalk.org/index.php?topic=577437.0\n", VAULT_BLOCK_REWARD);
  77. +       printf("CreateNewBlock(): There are %d of these Vault Blocks in total, starting at Block %d and released every other %dth block.\n", NUM_VAULT_BLOCKS, VAULT_BLOCK_1, VAULT_BLOCK_INTERVAL);
  78. +       printf("CreateNewBlock(): The purpose of the fund is to bring Mjollnircoin to an Exchange with a decent Volume and further promotion.\n");
  79. +       printf("CreateNewBlock(): Public accounting of the Vault is located here: http://brokkir.github.io/mjollnircoin/vault.html.\n");
  80. +   }
  81. +   else {
  82. +           pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
  83. +   }
  84. +          
  85. +   pblocktemplate->vTxFees[0] = -nFees;
  86. +      
  87.          // Fill in header
  88.          pblock->hashPrevBlock  = pindexPrev->GetBlockHash();
  89.          pblock->UpdateTime(pindexPrev);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement