mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-26 01:50:42 +00:00
Merge pull request #568 from theStack/maxmoney_unusedvar
max_money.py: use variable start_block_reward (eliminate magic number)
This commit is contained in:
commit
ecbde7c77c
@ -1,12 +1,11 @@
|
|||||||
# Original block reward for miners was 50 BTC
|
# Original block reward for miners was 50 BTC = 50 0000 0000 Satoshis
|
||||||
start_block_reward = 50
|
start_block_reward = 50 * 10**8
|
||||||
# 210000 is around every 4 years with a 10 minute block interval
|
# 210000 is around every 4 years with a 10 minute block interval
|
||||||
reward_interval = 210000
|
reward_interval = 210000
|
||||||
|
|
||||||
|
|
||||||
def max_money():
|
def max_money():
|
||||||
# 50 BTC = 50 0000 0000 Satoshis
|
current_reward = start_block_reward
|
||||||
current_reward = 50 * 10**8
|
|
||||||
total = 0
|
total = 0
|
||||||
while current_reward > 0:
|
while current_reward > 0:
|
||||||
total += reward_interval * current_reward
|
total += reward_interval * current_reward
|
||||||
|
Loading…
Reference in New Issue
Block a user