mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
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.
This commit is contained in:
parent
af550b3a0f
commit
d2465dfac6
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ import argparse
|
||||||
import collections
|
import collections
|
||||||
import ipaddress
|
import ipaddress
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
@ -211,6 +212,7 @@ def main():
|
||||||
with open(args.seeds, 'r', encoding='utf8') as f:
|
with open(args.seeds, 'r', encoding='utf8') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
ips = [parseline(line) for line in lines]
|
ips = [parseline(line) for line in lines]
|
||||||
|
random.shuffle(ips)
|
||||||
print('Done.', file=sys.stderr)
|
print('Done.', file=sys.stderr)
|
||||||
|
|
||||||
print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr)
|
print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue