-
Notifications
You must be signed in to change notification settings - Fork 1
/
mintAge.py
43 lines (32 loc) · 1.13 KB
/
mintAge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python3
import os, json, sys
# !!!This file operates against an unlocked wallet!!! Did you read the every line?
# You'll probably need to update the binary paths
try:
confirms = int(sys.argv[1])
except:
print('Usage: python3 mintAge.py 20000')
print('1 integer argument required for this script. Exiting...')
sys.exit(2)
block = os.popen('~/Downloads/veil-1.0.2/bin/veil-cli getblockcount').read()
var = os.popen('~/Downloads/veil-1.0.2/bin/veil-cli listmintedzerocoins true').read()
if block:
if var:
print("Mints found")
else:
print("Mints not found. Is the wallet unlocked?")
sys.exit()
else:
print("Veil daemon is not responding")
sys.exit()
mints = json.loads(var)
#print(mints)
# Filter python objects with list comprehensions
output_dict = [x for x in mints if x['confirmations'] > confirms]
# Transform python object back into json
output_json = json.dumps(output_dict)
print("Here are the serial hashes for your mints with over "+str(confirms)+" confirmations")
for mint in output_dict:
print(mint['serial hash'])
print(mintList)
print("finished")