def on_addr(self, message):
    for addr in message.addrs:
        assert_equal(addr.nServices, 9)
        if (not (8333 <= addr.port < 8343)):
            raise AssertionError('Invalid addr.port of {} (8333-8342 expected)'.format(addr.port))
        assert addr.ip.startswith('123.123.123.')
        self.num_ipv4_received += 1
def on_addr(self, message):
    for addr in message.addrs:
        assert_equal(addr.nServices, 9)
        if (not (8333 <= addr.port < 8343)):
            raise AssertionError('Invalid addr.port of {} (8333-8342 expected)'.format(addr.port))
        assert addr.ip.startswith('123.123.123.')
        self.num_ipv4_received += 1