Beispiel #1
0
def check_valid_seed_nodes():
    for chain, seeds in SEED_NODES.items():
        ips = [(host, resolve_dns(host), provider) for host, _, provider, *_ in seeds]
        for ip in set(x[1] for x in ips):
            found = [i for i in ips if i[1] == ip]
            if len(found) > 1:
                log.error('For chain {}, ip {} appears more than 1 time:'.format(chain, ip))
                for host, i, provider in found:
                    log.error(' - {}  ({})'.format(host, provider))
Beispiel #2
0
    def add_flag(country, ip):
        if not country:
            try:
                geo = get_geoip_info(resolve_dns(ip).split(':')[0])
                country = geo['country_iso'].lower()
            except (ValueError, AttributeError):
                pass

        return '<span>%s %s</span>' % (get_flag(country), ip)
Beispiel #3
0
    def add_flag(country, ip):
        if not country:
            try:
                geo = get_geoip_info(resolve_dns(ip).split(':')[0])
                country = geo['country_iso'].lower()
            except ValueError:
                pass

        return '<span>%s %s</span>' % (get_flag(country), ip)