Skip to content

Commit 5bab317

Browse files
committed
makeseeds: Configurable minimum blocks for testnet4's smaller chain
1 parent d2465df commit 5bab317

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/seeds/makeseeds.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
'ipv6': 10,
2727
}
2828

29-
MIN_BLOCKS = 730000
29+
MIN_BLOCKS = 840000
3030

3131
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$")
3232
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
@@ -198,6 +198,7 @@ def parse_args():
198198
argparser = argparse.ArgumentParser(description='Generate a list of bitcoin node seed ip addresses.')
199199
argparser.add_argument("-a","--asmap", help='the location of the asmap asn database file (required)', required=True)
200200
argparser.add_argument("-s","--seeds", help='the location of the DNS seeds file (required)', required=True)
201+
argparser.add_argument("-m", "--minblocks", help="The minimum number of blocks each node must have", default=MIN_BLOCKS, type=int)
201202
return argparser.parse_args()
202203

203204
def main():
@@ -224,7 +225,7 @@ def main():
224225
ips = dedup(ips)
225226
print(f'{ip_stats(ips):s} After removing duplicates', file=sys.stderr)
226227
# Enforce minimal number of blocks.
227-
ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS]
228+
ips = [ip for ip in ips if ip['blocks'] >= args.minblocks]
228229
print(f'{ip_stats(ips):s} Enforce minimal number of blocks', file=sys.stderr)
229230
# Require service bit 1.
230231
ips = [ip for ip in ips if (ip['service'] & 1) == 1]

0 commit comments

Comments
 (0)