Compare commits

...

6 Commits

Author SHA1 Message Date
penner42
6f2967a552 Merge pull request #210 from penner42/Issue-135
Issue 135
2014-01-31 11:43:51 -08:00
Alan Penner
42d6c47edc check shareid before shareid[0] 2014-01-31 11:38:17 -08:00
Alan Penner
223b172cc6 Merge branch 'ahmedmaster' 2014-01-31 11:35:39 -08:00
Alan Penner
052dc3ae58 fix indent 2014-01-31 09:15:43 -08:00
ahmedbodi
781aa0285a Update interfaces.py 2014-01-31 00:13:47 +00:00
ahmedbodi
7a6fd9ac30 Update README.md 2014-01-31 00:05:33 +00:00
4 changed files with 11 additions and 13 deletions

View File

@ -77,8 +77,7 @@ Please research and attempt to debug first.
* Original version by Slush0 and ArtForz (original stratum code)
* More Features added by GeneralFault, Wadee Womersley, Viperaus, TheSeven and Moopless
* Scrypt conversion from work done by viperaus
* Multi Algo, Vardiff, DB and MPOS support done by Ahmed_Bodi and Obigal
* Multi Algo, Vardiff, DB and MPOS support done by Ahmed_Bodi, penner42 and Obigal
#License
This software is provides AS-IS without any warranties of any kind. Please use at your own risk.

View File

@ -125,7 +125,7 @@ class DB_Mysql():
shareid = self.dbc.fetchone()
if shareid[0] > 0:
if shareid and shareid[0] > 0:
# Note: difficulty = -1 here
self.execute(
"""

View File

@ -83,7 +83,7 @@ class DB_Mysql_Vardiff(DB_Mysql.DB_Mysql):
shareid = self.dbc.fetchone()
if shareid[0] > 0:
if shareid and shareid[0] > 0:
# Note: difficulty = -1 here
self.execute(
"""
@ -113,16 +113,15 @@ class DB_Mysql_Vardiff(DB_Mysql.DB_Mysql):
%(lres)s, %(result)s, %(reason)s, %(solution)s)
""",
{
"time": v[4],
"host": v[6],
"uname": v[0],
"lres": v[5],
"result": v[5],
"reason": v[9],
"solution": v[2]
"time": data[4],
"host": data[6],
"uname": data[0],
"lres": data[5],
"result": data[5],
"reason": data[9],
"solution": data[2]
}
)
self.dbh.commit()

View File

@ -82,7 +82,7 @@ class ShareManagerInterface(object):
def on_submit_block(self, is_accepted, worker_name, block_header, block_hash, timestamp, ip, share_diff):
log.info("Block %s %s" % (block_hash, 'ACCEPTED' if is_accepted else 'REJECTED'))
dbi.do_import(True)
dbi.do_import(dbi, True)
dbi.found_block([worker_name, block_header, block_hash, -1, timestamp, is_accepted, ip, self.block_height, self.prev_hash, share_diff ])
class TimestamperInterface(object):