Merge pull request #4 from efecini/general-notes

code is complete
This commit is contained in:
Efe Cini 2019-12-16 21:06:04 +03:00 committed by GitHub
commit dccc01d996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,12 @@
from helpers import mainnet
from decimal import Decimal
#This little program tells you the bitcoin's cycle count and the bitcoin block reward amount
initial_subsidy = Decimal(50)
blocks_per_halvening = 210000
last_block = mainnet.getblockchaininfo()["blocks"]
cycle = int(last_block/blocks_per_halvening)
initial_subsidy /= cycle*2
print(f"Bitcoin is in the {cycle+1}. halvening cycle and the block reward is {initial_subsidy} btc right now.")