def store_current():
    """
    Stores the current logs in the database
    """
    for key, getwork_c in getworks.items():
        accepted_c = accepted.get(key, 0)
        rejected_c = rejected.get(key, 0)
        #Extract key information
        server = key[0]
        username = key[1]
        password = key[2]
        difficulty = key[3]
        timestamp = time.asctime(time.gmtime())
        
        #If this isn't the current difficulty we are not responsible for storing it
        try:
            if get_diff(server) != difficulty:
                continue
        except:
            logging.error(traceback.format_exc())
            continue
            
        #Do an update
        sql = "UPDATE Statistics SET Getworks = %s, Accepted = %s, Rejected = %s, Timestamp = '%s' WHERE Server = '%s' AND Username = '%s' AND Password = '%s' AND Difficulty = %s" % (getwork_c, accepted_c, rejected_c, timestamp, server, username, password, difficulty)
        bitHopper.Database.execute(sql)
        
        #Check if we actually updated something
        result = bitHopper.Database.execute('SELECT Getworks from Statistics WHERE Server = "%s" AND Username = "%s" AND Password = "%s" AND Difficulty = %s' % (server, username, password, difficulty))
        result = list(result)
        
        #If we didn't do an insert
        if len(result) == 0:
            sql = "INSERT INTO Statistics (Server, Username, Password, Difficulty, Timestamp, Getworks, Accepted, Rejected) VALUES ('%s', '%s', '%s', %s, '%s', %s, %s, %s)" % (server, username, password, difficulty, timestamp, getwork_c, accepted_c, rejected_c)
            bitHopper.Database.execute(sql)
dataset/ETHPy150Open c00w/bitHopper/bitHopper/Tracking/Tracking.py/store_current/original