コード例 #1
0
    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()
コード例 #2
0
ファイル: voter.py プロジェクト: benjaminbollen/bigchaindb
    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()
コード例 #3
0
def initial():
    """Return unvoted blocks."""
    b = Bigchain()
    rs = b.get_unvoted_blocks()
    return rs
コード例 #4
0
ファイル: vote.py プロジェクト: sbellem/bigchaindb
def initial():
    """Return unvoted blocks."""
    b = Bigchain()
    rs = b.get_unvoted_blocks()
    return rs