def sync_blocks(self, blockhash, num_blocks):

    def blocks_requested():
        return all((((blockhash in node.block_request_map) and node.block_request_map[blockhash]) for node in self.test_nodes))
    if (not wait_until(blocks_requested, attempts=(20 * num_blocks), sleep=0.1)):
        raise AssertionError('Not all nodes requested block')
    [c.cb.send_getheaders() for c in self.connections]
    [c.cb.send_ping(self.ping_counter) for c in self.connections]
    self.wait_for_pings(self.ping_counter, timeout=300)
    self.ping_counter += 1
def sync_blocks(self, blockhash, num_blocks):

    def blocks_requested():
        return all((((blockhash in node.block_request_map) and node.block_request_map[blockhash]) for node in self.test_nodes))
    if (not wait_until(blocks_requested, attempts=(20 * num_blocks), sleep=0.1)):
        raise AssertionError('Not all nodes requested block')
    [c.cb.send_getheaders() for c in self.connections]
    [c.cb.send_ping(self.ping_counter) for c in self.connections]
    self.wait_for_pings(self.ping_counter, timeout=300)
    self.ping_counter += 1