def run(self):
    rows = super.session.execute('select sha256_id, pq, proposal, verdict, target, raw_statement, block_id\n        from candidate where ready = true and processed = false')
    candidates = []
    ids = []
    for row in rows:
        [sha256_id, pq, proposal, verdict, target, raw_statement, block_id] = row
        candidates.append('||'.join([pq, proposal, verdict, target, raw_statement, block_id]))
        ids.append(sha256_id)
    candidates.sort()
    candidate_transactions = '@@'.join(candidates)
    predecessor = self.block_id
    raw = '<{0}/{1}/{2}>{3}'.format(self.block_ptr, self.nonce, predecessor, candidate_transactions)
    self.publicMining(raw)
    for shaId in ids:
        super.session.execute(self.updateStatusStatement, [shaId])
def run(self):
    rows = super.session.execute('select sha256_id, pq, proposal, verdict, target, raw_statement, block_id\n        from candidate where ready = true and processed = false')
    candidates = []
    ids = []
    for row in rows:
        [sha256_id, pq, proposal, verdict, target, raw_statement, block_id] = row
        candidates.append('||'.join([pq, proposal, verdict, target, raw_statement, block_id]))
        ids.append(sha256_id)
    candidates.sort()
    candidate_transactions = '@@'.join(candidates)
    predecessor = self.block_id
    raw = '<{0}/{1}/{2}>{3}'.format(self.block_ptr, self.nonce, predecessor, candidate_transactions)
    self.publicMining(raw)
    for shaId in ids:
        super.session.execute(self.updateStatusStatement, [shaId])