Merge #17823: scripts: Read suspicious hosts from a file instead of hardcoding

e1c582cbaa4c094d204da34c3b1fdd0d4c557519 contrib: makeseeds: Read suspicious hosts from a file instead of hardcoding (Sanjay K)

Pull request description:

  referring to: https://github.com/bitcoin/bitcoin/issues/17020
  good first issue: reading SUSPICIOUS_HOSTS from a file.
  I haven't changed the base hosts that were included in the original source, just made it readable from a file.

ACKs for top commit:
  practicalswift:
    ACK e1c582cbaa4c094d204da34c3b1fdd0d4c557519 -- diff looks correct

Tree-SHA512: 18684abc1c02cf52d63f6f6ecd98df01a9574a7c470524c37e152296504e2e3ffbabd6f3208214b62031512aeb809a6d37446af82c9f480ff14ce4c42c98e7c2
This commit is contained in:
Wladimir J. van der Laan 2020-01-20 20:24:27 +01:00 committed by PastaPastaPasta
parent 038eae1b4b
commit 8c6fb5622d
2 changed files with 3 additions and 2 deletions

View File

@ -19,8 +19,9 @@ MAX_SEEDS_PER_ASN=4
# These are hosts that have been observed to be behaving strangely (e.g. # These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node). # aggressively connecting to every node).
SUSPICIOUS_HOSTS = { 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_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+)$") PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")

View File