From 6ff34af50ebfa3ccc4a0cfa46f9a73cec363855b Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 30 Mar 2018 14:16:57 +0200 Subject: [PATCH] set U as default --- plugins/currency/zcash/zcash_flypool_hashrate_ | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/currency/zcash/zcash_flypool_hashrate_ b/plugins/currency/zcash/zcash_flypool_hashrate_ index 4eec991d..079f7198 100755 --- a/plugins/currency/zcash/zcash_flypool_hashrate_ +++ b/plugins/currency/zcash/zcash_flypool_hashrate_ @@ -85,22 +85,21 @@ except IOError as exc: # manage codec and error handling lookup process reader = codecs.getreader("utf-8") +hash_rate = "U" + try: mining_stats = json.load(reader(mining_stats_raw)) except ValueError: print("Failed to parse JSON responce.", file=sys.stderr) - print("flypool_hs_{}_{}.value U".format(zcash_address, miner)) else: try: worker = mining_stats['data'] except (KeyError, TypeError): print("JSON result error!", file=sys.stderr) - print("flypool_hs_{}_{}.value U".format(zcash_address, miner)) else: try: hash_rate = worker['currentHashrate'] except (KeyError, TypeError): print("No current Hashrate!", file=sys.stderr) - print("flypool_hs_{}_{}.value U".format(zcash_address, miner)) - else: - print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate)) + +print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate))