def wait_for_inv(self, expected_inv, timeout=60):
    'Waits for an INV message and checks that the first inv object in the message was as expected.'
    if (len(expected_inv) > 1):
        raise NotImplementedError('wait_for_inv() will only verify the first inv object')
    test_function = (lambda : (self.last_message.get('inv') and (self.last_message['inv'].inv[0].type == expected_inv[0].type) and (self.last_message['inv'].inv[0].hash == expected_inv[0].hash)))
    wait_until(test_function, timeout=timeout, lock=mininode_lock)
Waits for an INV message and checks that the first inv object in the message was as expected.
def wait_for_inv(self, expected_inv, timeout=60):
    
    if (len(expected_inv) > 1):
        raise NotImplementedError('wait_for_inv() will only verify the first inv object')
    test_function = (lambda : (self.last_message.get('inv') and (self.last_message['inv'].inv[0].type == expected_inv[0].type) and (self.last_message['inv'].inv[0].hash == expected_inv[0].hash)))
    wait_until(test_function, timeout=timeout, lock=mininode_lock)