Merge cddcd22ab3 into merged_master (Bitcoin PR #20288)

This commit is contained in:
Andrew Poelstra 2020-12-03 04:49:50 +00:00
commit f455acefd6
2 changed files with 8 additions and 2 deletions

View file

@ -16,6 +16,12 @@ The seeds compiled into the release are created from sipa's DNS seed data, like
## Dependencies
Ubuntu:
Ubuntu, Debian:
sudo apt-get install python3-dnspython
and/or for other operating systems:
pip install dnspython
See https://dnspython.readthedocs.io/en/latest/installation.html for more information.

View file

@ -136,7 +136,7 @@ def lookup_asn(net, ip):
ipaddr = res.rstrip('.') # 2.0.0.1.4.8.6.0.b.0.0.2.0.0.2.3
prefix = '.origin6'
asn = int([x.to_text() for x in dns.resolver.query('.'.join(
asn = int([x.to_text() for x in dns.resolver.resolve('.'.join(
reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com',
'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn