Skip to content

Commit d2465df

Browse files
committed
makeseeds: Shuffle ips after parsing
The crawlers are not guaranteed to output nodes in a random order, so shuffle the ips list after parsing to break any biasing that may be caused by the output order.
1 parent af550b3 commit d2465df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/seeds/makeseeds.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import collections
1111
import ipaddress
1212
from pathlib import Path
13+
import random
1314
import re
1415
import sys
1516
from typing import Union
@@ -211,6 +212,7 @@ def main():
211212
with open(args.seeds, 'r', encoding='utf8') as f:
212213
lines = f.readlines()
213214
ips = [parseline(line) for line in lines]
215+
random.shuffle(ips)
214216
print('Done.', file=sys.stderr)
215217

216218
print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr)

0 commit comments

Comments
 (0)