reliability updates

This commit is contained in:
2018-01-30 08:20:28 -08:00
parent d8fe60c078
commit 514ca57067

View File

@@ -40,22 +40,30 @@ try:
exchrate=float(json.loads(fetch("https://api.coinbase.com/v2/exchange-rates?currency=BTC"))["data"]["rates"][currency]) exchrate=float(json.loads(fetch("https://api.coinbase.com/v2/exchange-rates?currency=BTC"))["data"]["rates"][currency])
data=json.loads(fetch("http://www.zpool.ca/api/status")) data=json.loads(fetch("http://www.zpool.ca/api/status"))
except: except:
print("unable to retrieve remote data", file=sys.stderr) if (len(sys.argv)!=5):
sys.exit(-1) print("unable to retrieve remote data", file=sys.stderr)
sys.exit(-1)
else:
pass
# update algo map # update algo map
changed=False try:
for i in data: changed=False
try: for i in data:
k=algo_map[i] try:
except: k=algo_map[i]
algo_map[i]="" except:
changed=True algo_map[i]=""
changed=True
if (changed==True): if (changed==True):
with open(sys.argv[3], "w") as outfile: with open(sys.argv[3], "w") as outfile:
json.dump(algo_map, outfile, sort_keys=True, indent=2) json.dump(algo_map, outfile, sort_keys=True, indent=2)
except:
print("null response from server", file=sys.stderr)
sys.exit(-1)
# weed out miners not supported by the pool # weed out miners not supported by the pool