diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-04-16 11:13:07 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-04-16 17:25:11 +0200 |
commit | f020aca297e8a6c9f7b6a6e08e583847d37edace (patch) | |
tree | b7573c8faefcf5c92d21f1bd297fc72a8da3393f /contrib/seeds/generate-seeds.py | |
parent | 0d6992168c2bda85b18fda8f6dea08da433a0dc9 (diff) |
Minor Python cleanups to make flake8 pass with the new rules enabled
Diffstat (limited to 'contrib/seeds/generate-seeds.py')
-rwxr-xr-x | contrib/seeds/generate-seeds.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py index 2790ef4acd..72eb7255f3 100755 --- a/contrib/seeds/generate-seeds.py +++ b/contrib/seeds/generate-seeds.py @@ -34,7 +34,8 @@ These should be pasted into `src/chainparamsseeds.h`. from base64 import b32decode from binascii import a2b_hex -import sys, os +import sys +import os import re # ipv4 in ipv6 prefix @@ -46,7 +47,7 @@ def name_to_ipv6(addr): if len(addr)>6 and addr.endswith('.onion'): vchAddr = b32decode(addr[0:-6], True) if len(vchAddr) != 16-len(pchOnionCat): - raise ValueError('Invalid onion %s' % s) + raise ValueError('Invalid onion %s' % vchAddr) return pchOnionCat + vchAddr elif '.' in addr: # IPv4 return pchIPv4 + bytearray((int(x) for x in addr.split('.'))) @@ -132,7 +133,7 @@ def main(): with open(os.path.join(indir,'nodes_test.txt'),'r') as f: process_nodes(g, f, 'pnSeed6_test', 18333) g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') - + if __name__ == '__main__': main() |