Check block reward

0

So this is an exercise for fun as we know the block reward already.

But how would you get the bitcoind to show the block reward for the next block?

There is no bitcoind getblockreward but is there a way to discover the block reward from the commands available in bitcoind.

Peter Bushnell

Posted 2012-12-25T13:37:53.993

Reputation: 194

Answers

2

With getblockcount you can get the height of the latest block. Then the reward of the next block is 50 / 2 ^ Floor ((blockcount+1)/210000). In some programming environments 5000000000>>((blockcount+1)/210000) will give the desired result in satoshis.

Meni Rosenfeld

Posted 2012-12-25T13:37:53.993

Reputation: 18 542

This works as we know the total coins. But going outside the scope of Bitcoin, what if we didn't know the total coins like Freicoin and the reward decreases over time.Peter Bushnell 2012-12-25T14:05:17.573

@Bushstar: I don't know how to answer the general question. (I'm not sure if this information is explicitly available in the coinbase tx data, and even if so, the gettransaction call seems to work only for txs in the wallet). I'm not even sure if it's meaningful - an alt might have a completely different notion of block reward or a different API, so you can't devise a coin-agnostic procedure. And if it's just Bitcoin, the above applies.Meni Rosenfeld 2012-12-25T20:55:50.267