def test_end_to_end_block_relay(self, listeners):
    node = self.nodes[0]
    utxo = self.utxos.pop(0)
    block = self.build_block_with_transactions(node, utxo, 10)
    [l.clear_block_announcement() for l in listeners]
    node.submitblock(ToHex(block))
    for l in listeners:
        wait_until((lambda : l.received_block_announcement()), timeout=30, lock=mininode_lock)
    with mininode_lock:
        for l in listeners:
            assert ('cmpctblock' in l.last_message)
            l.last_message['cmpctblock'].header_and_shortids.header.calc_sha256()
            assert_equal(l.last_message['cmpctblock'].header_and_shortids.header.sha256, block.sha256)
def test_end_to_end_block_relay(self, listeners):
    node = self.nodes[0]
    utxo = self.utxos.pop(0)
    block = self.build_block_with_transactions(node, utxo, 10)
    [l.clear_block_announcement() for l in listeners]
    node.submitblock(ToHex(block))
    for l in listeners:
        wait_until((lambda : l.received_block_announcement()), timeout=30, lock=mininode_lock)
    with mininode_lock:
        for l in listeners:
            assert ('cmpctblock' in l.last_message)
            l.last_message['cmpctblock'].header_and_shortids.header.calc_sha256()
            assert_equal(l.last_message['cmpctblock'].header_and_shortids.header.sha256, block.sha256)