Changeset View
Changeset View
Standalone View
Standalone View
contrib/seeds/makeseeds.py
Show All 31 Lines | PATTERN_IPV4 = re.compile( | ||||
r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") | 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+)$") | ||||
PATTERN_ONION = re.compile( | PATTERN_ONION = re.compile( | ||||
r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$") | r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$") | ||||
# Used to only select nodes with a user agent string compatible with the | # Used to only select nodes with a user agent string compatible with the | ||||
# BCH/UAHF specification. | # BCH/UAHF specification. | ||||
PATTERN_AGENT = re.compile( | PATTERN_AGENT = re.compile( | ||||
r"^(/Bitcoin ABC:0.(20).(\d+)\(.+\)/|/bcash:v1.(\d+).(\d+)-(\S+)/)") | r"^(/Bitcoin ABC:0.(19|20).(\d+)\(.+\)/|/bcash:v1.(\d+).(\d+)-(\S+)/)") | ||||
def parseline(line): | def parseline(line): | ||||
sline = line.split() | sline = line.split() | ||||
if len(sline) < 11: | if len(sline) < 11: | ||||
return None | return None | ||||
# The user agent is at the end of the line. It may contain space, so we concatenate. | # The user agent is at the end of the line. It may contain space, so we concatenate. | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |