Skip to content

Commit

Permalink
Switch mining to api2
Browse files Browse the repository at this point in the history
  • Loading branch information
YoRyan committed Oct 12, 2019
1 parent e9a5001 commit f46fdc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions nuxhash/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ def run(self):
payrates = stratums = None
while payrates is None:
try:
payrates, stratums = nicehash.simplemultialgo_info(self._settings)
payrates = nicehash.simplemultialgo_info(self._settings)
stratums = nicehash.stratums(self._settings)
except NH_EXCEPTIONS as err:
logging.warning('NiceHash stats: %s, retrying in 5 seconds' % err)
logging.warning(f'NiceHash stats: {err}, retrying in 5 seconds')
time.sleep(5)
else:
self._payrates = (payrates, datetime.now())
Expand All @@ -277,7 +278,7 @@ def stop(self):
def _switch_algos(self):
# Get profitability information from NiceHash.
try:
ret_payrates, stratums = nicehash.simplemultialgo_info(self._settings)
ret_payrates = nicehash.simplemultialgo_info(self._settings)
except NH_EXCEPTIONS as err:
logging.warning('NiceHash stats: %s' % err)
else:
Expand Down
8 changes: 4 additions & 4 deletions nuxhash/gui/mining.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ def run(self):
stratums = None
while stratums is None:
try:
payrates, stratums = nicehash.simplemultialgo_info(
self._settings)
payrates = nicehash.simplemultialgo_info(self._settings)
stratums = nicehash.stratums(self._settings)
except NH_EXCEPTIONS as err:
logging.warning('NiceHash stats: %s, retrying in 5 seconds' % err)
logging.warning(f'NiceHash stats: {err}, retrying in 5 seconds')
time.sleep(5)
else:
self._payrates = payrates
Expand All @@ -348,7 +348,7 @@ def stop(self):
def _switch_algos(self):
# Get profitability information from NiceHash.
try:
ret_payrates, stratums = nicehash.simplemultialgo_info(self._settings)
ret_payrates = nicehash.simplemultialgo_info(self._settings)
except NH_EXCEPTIONS as err:
logging.warning('NiceHash stats: %s' % err)
else:
Expand Down

0 comments on commit f46fdc8

Please sign in to comment.