def sync_transaction(self, txhash, num_events):

    def transaction_requested():
        return all((((txhash in node.tx_request_map) and node.tx_request_map[txhash]) for node in self.test_nodes))
    if (not wait_until(transaction_requested, attempts=(20 * num_events))):
        raise AssertionError('Not all nodes requested transaction')
    [c.cb.send_mempool() for c in self.connections]
    [c.cb.send_ping(self.ping_counter) for c in self.connections]
    self.wait_for_pings(self.ping_counter)
    self.ping_counter += 1
    with mininode_lock:
        [c.cb.lastInv.sort() for c in self.connections]
def sync_transaction(self, txhash, num_events):

    def transaction_requested():
        return all((((txhash in node.tx_request_map) and node.tx_request_map[txhash]) for node in self.test_nodes))
    if (not wait_until(transaction_requested, attempts=(20 * num_events))):
        raise AssertionError('Not all nodes requested transaction')
    [c.cb.send_mempool() for c in self.connections]
    [c.cb.send_ping(self.ping_counter) for c in self.connections]
    self.wait_for_pings(self.ping_counter)
    self.ping_counter += 1
    with mininode_lock:
        [c.cb.lastInv.sort() for c in self.connections]