Browse Source

attempting to update the api

excadual
Adam Piontek 1 year ago
parent
commit
ebe46e9169
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      kmm/apis/excavator.py

+ 10
- 1
kmm/apis/excavator.py View File

@@ -13,4 +13,13 @@ def get_hashrate(apiport, dual):
data = json.loads(str(data, 'utf-8'))
if len(data['algorithms']) == 0:
return False
return float(data['algorithms'][0]['workers'][0]['speed'][0])
if not dual:
return float(data['algorithms'][0]['workers'][0]['speed'][0])
elif dual:
return data['algorithms'][0]['workers'][0]['speed']
###### claymore version:
# rates = []
# rates.append(float(data['result'][2].split(';')[0])*1000)
# rates.append(float(data['result'][4].split(';')[0])*1000)
# logger.debug("Dual return is {r1} and {r2} for {rates} from:\n{data}".format(r1=(float(data['result'][2].split(';')[0])*1000), r2=(float(data['result'][4].split(';')[0])*1000), rates=rates, data=data))
# return rates

Loading…
Cancel
Save