Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/s/t/stratum-mining-HEAD/mining/DB_Postgresql.py   stratum-mining(Download)
        best_diff = 0
        for k,v in enumerate(data):
            if settings.DATABASE_EXTEND :
                total_shares += v[3]
                if v[0] in checkin_times:
                        (v[4],v[6],v[0],bool(v[5]),False,v[9],'') )
 
        if settings.DATABASE_EXTEND :
            self.dbc.execute("select value from pool where parameter = 'round_shares'")
            round_shares = int(self.dbc.fetchone()[0]) + total_shares
    def found_block(self,data):
        # Note: difficulty = -1 here
        self.dbc.execute("update shares set upstream_result = %s, solution = %s where id in (select id from shares where time = to_timestamp(%s) and username = %s limit 1)",
                (bool(data[5]),data[2],data[4],data[0]))
        if settings.DATABASE_EXTEND and data[5] == True :
    def clear_worker_diff(self):
        if settings.DATABASE_EXTEND == True :
            self.dbc.execute("update pool_worker set difficulty = 0")
            self.dbh.commit()
 
            self.update_version_1()
 
        if settings.DATABASE_EXTEND == True :
            self.update_tables()
 

src/s/t/stratum-mining-HEAD/mining/DB_Sqlite.py   stratum-mining(Download)
        sqldata = []
        for k,v in enumerate(data):
            if settings.DATABASE_EXTEND :
                total_shares += v[3]
                if v[0] in checkin_times:
                sqldata.append({'time':v[4],'rem_host':v[6],'username':v[0],'our_result':v[5],'upstream_result':0,'reason':v[9],'solution':''} )
 
        if settings.DATABASE_EXTEND :
            self.dbc.executemany("insert into shares " +\
                "(time,rem_host,username,our_result,upstream_result,reason,solution,block_num,prev_block_hash,useragent,difficulty) " +\
    def found_block(self,data):
        # Note: difficulty = -1 here
        self.dbc.execute("update shares set upstream_result = :usr, solution = :sol where time = :time and username = :user",
                {'usr':data[5],'sol':data[2],'time':data[4],'user':data[0]})
        if settings.DATABASE_EXTEND and data[5] == True :
    def clear_worker_diff(self):
        if settings.DATABASE_EXTEND == True :
            self.dbc.execute("update pool_worker set difficulty = 0")
            self.dbh.commit()
 
    def check_tables(self):
        log.debug("Checking Tables")
        if settings.DATABASE_EXTEND == True :
                self.dbc.execute("create table if not exists shares" +\
                        "(time DATETIME,rem_host TEXT, username TEXT, our_result INTEGER, upstream_result INTEGER, reason TEXT, solution TEXT, " +\