2

Been working my way trough the main.cpp trying to see where this value is grabbed if at all.

I need a way to check how many coins have been mined regardless of block count. For example if every block has a random value how would one go about storing coins mined.

Continuously getting the value of the previous block and adding it to a coins mined int would be one solution, but where in main.cpp would it be best to do this and how?

I would need to be able to apply this value for generation of new blocks in GetBlockValue()

Is this value already parsed somewhere when parsing the previous block? Or is it disregarded seeing as the original bitcoin and litecoin had a set value pr block + fees?

Would really appreciate assistance in this matter. Or an extremely well commentated main.cpp.

  • "every block has a random value" - are you talking about Bitcoin, or an altcoin such as Dogecoin where the mining payout is variable? – Greg Hewgill Feb 1 '14 at 19:31
  • You can find this using math for Bitcoin (math may be different for other coins). Block reward halves every 210,000 blocks. For right now it'd be 210,000 * 50 + (blockheight - 210,000) * 25 – John T Feb 2 '14 at 9:18
  • Dogecoin would be a good example where your math example wouldn't work. If every block has a random value how do you check how many coins have been mined? This seems to have been disregarded in the original bitcoin and litecoin source seeing as each block has a set value. Im trying to get this value based on the actual number of coins mined regardless of block count. – user12970 Feb 2 '14 at 16:04
  • Did you ever figure this out? – theSociableme Mar 18 '14 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.