contrib: Update makeseeds.py (#3790)

* contrib: Update makeseeds.py 

The `dnspython` package complained about  `dns.resolver.Resolver.query()` being deprecated and suggested to use `dns.resolver.Resolver.resolve()` instead.

* contrib: Update dependency install instructions in seeds/README.md
This commit is contained in:
dustinface 2020-11-08 15:44:47 +01:00 committed by GitHub
parent 69b36f9672
commit c37193fa82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -17,4 +17,5 @@ that the list is as expected.
Ubuntu:
sudo apt-get install python3-dnspython
sudo apt-get install python3-pip
pip3 install dnspython

View File

@ -91,7 +91,7 @@ def filtermultipayoutaddress(mns):
return [mn for mn in mns if len(hist[mn['state']['payoutAddress']]) == 1]
def resolveasn(resolver, ip):
asn = int([x.to_text() for x in resolver.query('.'.join(reversed(ip.split('.'))) + '.origin.asn.cymru.com', 'TXT').response.answer][0].split('\"')[1].split(' ')[0])
asn = int([x.to_text() for x in resolver.resolve('.'.join(reversed(ip.split('.'))) + '.origin.asn.cymru.com', 'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn
# Based on Greg Maxwell's seed_filter.py