#NEWLINE# def incomplete_blocks( self , from_block = None , max_count = 1000 ) : #NEWLINE# #INDENT# cursor = self . _cursor ( ) #NEWLINE# sql = ' where txn_count = 0 and mainchain = 1 and height >= 0' #NEWLINE# if from_block : #NEWLINE# #INDENT# sql += ( ' and id > %d' % from_block . _blockid ) #NEWLINE# #UNINDENT# sql += ' order by id asc' #NEWLINE# if max_count : #NEWLINE# #INDENT# sql += ( ' limit %d' % max_count ) #NEWLINE# #UNINDENT# cursor . execute ( ( self . sql_select + sql ) ) #NEWLINE# return [ Block ( self , r ) for r in cursor . fetchall ( ) ]