def __init__(self, new_blocks): """ Create a new BlockStream instance. Args: new_block (queue): a queue of new blocks """ b = Bigchain() self.new_blocks = new_blocks # TODO: there might be duplicate blocks since we *first* get the changefeed and only *then* we query the # database to get the old blocks. # TODO how about a one liner, something like: # self.unvoted_blocks = b.get_unvoted_blocks() if not b.federation_nodes else [] self.unvoted_blocks = [] if not b.federation_nodes: self.unvoted_blocks = b.get_unvoted_blocks()
def __init__(self, new_blocks): """ Create a new BlockStream instance. Args: new_block (queue): a queue of new blocks """ b = Bigchain() self.new_blocks = new_blocks # TODO: there might be duplicate blocks since we *first* get the changefeed and only *then* we query the # database to get the old blocks. # TODO how about a one liner, something like: # self.unvoted_blocks = b.get_unvoted_blocks() if not b.federation_nodes else [] self.unvoted_blocks = [] if not b.federation_nodes: self.unvoted_blocks = b.get_unvoted_blocks()
def initial(): """Return unvoted blocks.""" b = Bigchain() rs = b.get_unvoted_blocks() return rs
def initial(): """Return unvoted blocks.""" b = Bigchain() rs = b.get_unvoted_blocks() return rs