mirror of
https://github.com/efecini/mooniversity_examples.git
synced 2025-06-06 18:31:08 +00:00
Made the generic variables capital
This commit is contained in:
parent
d91c8e9a2e
commit
c6d2dada64
@ -3,12 +3,12 @@ from decimal import Decimal
|
|||||||
|
|
||||||
def calculate_bitcoin_cycle_and_block_reward():
|
def calculate_bitcoin_cycle_and_block_reward():
|
||||||
#This little program tells you the bitcoin's cycle count and the bitcoin block reward amount
|
#This little program tells you the bitcoin's cycle count and the bitcoin block reward amount
|
||||||
initial_subsidy = Decimal(50)
|
INITIAL_SUBSIDY = Decimal(50)
|
||||||
blocks_per_halvening = 210000
|
BLOCKS_PER_HALVENING = 210000
|
||||||
last_block = mainnet.getblockchaininfo()["blocks"]
|
last_block = mainnet.getblockchaininfo()["blocks"]
|
||||||
cycle_count = int(last_block/blocks_per_halvening)
|
cycle_count = int(last_block/BLOCKS_PER_HALVENING)
|
||||||
initial_subsidy /= cycle_count*2
|
block_reward = INITIAL_SUBSIDY / cycle_count*2
|
||||||
return {"Cycle":cycle_count+1, "Block_reward":initial_subsidy}
|
return {"Cycle":cycle_count+1, "Block_reward":block_reward}
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cycle = calculate_bitcoin_cycle_and_block_reward()
|
cycle = calculate_bitcoin_cycle_and_block_reward()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user