From a8a0b09be20516e11dcab55d0bfb73d21f361969 Mon Sep 17 00:00:00 2001 From: youjying Date: Thu, 20 Mar 2014 14:03:30 -0600 Subject: [PATCH] user nonexistance error some servers like to allow people to connect with no signup. this avoids the issue of not having a user created. perhaps missing a uid generator? --- mining/DBInterface.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mining/DBInterface.py b/mining/DBInterface.py index 4fddd41..f7e9548 100644 --- a/mining/DBInterface.py +++ b/mining/DBInterface.py @@ -179,6 +179,13 @@ class DBInterface(): self.dbi.insert_worker(uid, username, password) self.cache.set(username, password) return True + else: + self.dbi.insert_user(username, password) + if self.dbi.get_uid(username) != False: + uid = self.dbi.get_uid(username) + self.dbi.insert_worker(uid, username, password) + self.cache.set(username, password) + return True log.info("Authentication for %s failed" % username) return False