diff options
author | Sanjay K <sanjaykdragon@gmail.com> | 2019-12-28 19:36:39 -0500 |
---|---|---|
committer | Sanjay K <sanjaykdragon@gmail.com> | 2020-01-06 19:48:58 -0500 |
commit | e1c582cbaa4c094d204da34c3b1fdd0d4c557519 (patch) | |
tree | f4b7c642b037610c4b6d4a186f51dd788904a81e | |
parent | b931f61b9ab098ea4ea8fbe4cbf0b03c566c3f63 (diff) |
contrib: makeseeds: Read suspicious hosts from a file instead of hardcoding
-rwxr-xr-x | contrib/seeds/makeseeds.py | 10 | ||||
-rw-r--r-- | contrib/seeds/suspicious_hosts.txt | 16 |
2 files changed, 19 insertions, 7 deletions
diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py index ec589d4c02..576ea5eb4b 100755 --- a/contrib/seeds/makeseeds.py +++ b/contrib/seeds/makeseeds.py @@ -19,13 +19,9 @@ MIN_BLOCKS = 337600 # These are hosts that have been observed to be behaving strangely (e.g. # aggressively connecting to every node). -SUSPICIOUS_HOSTS = { - "130.211.129.106", "178.63.107.226", - "83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6", - "54.173.72.127", "54.174.10.182", "54.183.64.54", "54.194.231.211", - "54.66.214.167", "54.66.220.137", "54.67.33.14", "54.77.251.214", - "54.94.195.96", "54.94.200.247" -} +with open("suspicious_hosts.txt", mode="r", encoding="utf-8") as f: + SUSPICIOUS_HOSTS = {s.strip() for s in f if s.strip()} + PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$") diff --git a/contrib/seeds/suspicious_hosts.txt b/contrib/seeds/suspicious_hosts.txt new file mode 100644 index 0000000000..13385cc816 --- /dev/null +++ b/contrib/seeds/suspicious_hosts.txt @@ -0,0 +1,16 @@ +130.211.129.106 +148.251.238.178 +176.9.46.6 +178.63.107.226 +54.173.72.127 +54.174.10.182 +54.183.64.54 +54.194.231.211 +54.66.214.167 +54.66.220.137 +54.67.33.14 +54.77.251.214 +54.94.195.96 +54.94.200.247 +83.81.130.26 +88.198.17.7
\ No newline at end of file |