Skip to content

Instantly share code, notes, and snippets.

@jtgrassie
Created August 17, 2019 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtgrassie/a2861cbdf80490280b7acc6e098b07a1 to your computer and use it in GitHub Desktop.
Save jtgrassie/a2861cbdf80490280b7acc6e098b07a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
height = 1902391
if len(sys.argv) == 2:
try:
height = int(sys.argv[1])
except:
print("Error parsing height")
print("Usage: {} <height>".format(sys.argv[0]))
print("Falling back to a preset default ({})".format(height))
v2 = 1009827
M = 2**64-1
A = 0
h = 0
while h < height and h < v2:
A += ((M-A) * 2**-20)
h += 1
while h < height:
A += ((M-A) * 2**-20 * 2)
h += 1
print("Maximum allowed emission for height {} is {} XMR".format(height, int(A)*10**-12))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment