Advertisement
JudeAustin

P2Pool DB Shit

Nov 6th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. try:
  2. dbf_user = request.getUser()
  3. dbuser_items = dbf_user.split('+')
  4. db_diff = bitcoin_data.target_to_difficulty(target) * 1000000000
  5. proxy_db = MySQLdb.connect(host="localhost",user="jason",passwd="p2pool2012",db="p2pmining")
  6. pdb_c = proxy_db.cursor()
  7. pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) )
  8. proxy_db.close()
  9. except:
  10. log.err(None, 'Error with database:')
  11. ###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement