reliability updates

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

View File

@@ -40,11 +40,15 @@ try:
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"))
except:
if (len(sys.argv)!=5):
print("unable to retrieve remote data", file=sys.stderr)
sys.exit(-1)
else:
pass
# update algo map
try:
changed=False
for i in data:
try:
@@ -56,6 +60,10 @@ for i in data:
if (changed==True):
with open(sys.argv[3], "w") as outfile:
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