Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't exit on wrong username/password. Keep trying with the other servers #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions BitcoinMiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,24 @@ def getwork(self, data=None):
self.failback_getwork_count = 0
self.failback_attempt_count = 0
return result['result']
except NotAuthorized:
self.failure('Wrong username or password')
except RPCError as e:
self.say('%s', e)
except (IOError, httplib.HTTPException, ValueError):
except (IOError, httplib.HTTPException, ValueError, NotAuthorized) as e:
if save_pool:
self.failback_attempt_count += 1
self.setpool(save_pool)
self.sayLine('Still unable to reconnect to primary pool (attempt %s), failing over', self.failback_attempt_count)
self.failback_getwork_count = 0
return
self.say('Problems communicating with bitcoin RPC %s %s', (self.errors, self.options.tolerance))

self.say('%s %s %s', (
if_else((type(e).__name__ == "NotAuthorized"),
'Wrong username or password',
'Problems communicating with bitcoin RPC'),
self.errors,
self.options.tolerance)
)

self.errors += 1
if self.errors > self.options.tolerance+1:
self.errors = 0
Expand Down