Skip to content

Commit 45d9e58

Browse files
committed
merge bitcoin#22960: Set peertimeout in write_config
1 parent 06e909b commit 45d9e58

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

test/functional/feature_bip68_sequence.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ class BIP68Test(BitcoinTestFramework):
3838
def set_test_params(self):
3939
self.num_nodes = 2
4040
self.extra_args = [
41-
[
42-
"-acceptnonstdtxn=1",
43-
"-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise
44-
],
41+
["-acceptnonstdtxn=1"],
4542
["-acceptnonstdtxn=0"],
4643
]
4744

test/functional/feature_maxuploadtarget.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def set_test_params(self):
3838
self.extra_args = [[
3939
"-maxuploadtarget=200",
4040
"-blockmaxsize=999000",
41-
"-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise
4241
"-maxtipage="+str(2*60*60*24*7),
4342
"-acceptnonstdtxn=1"
4443
]]

test/functional/test_framework/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ def write_config(config_path, *, n, chain, extra_config=""):
373373
f.write("dnsseed=0\n")
374374
f.write("fixedseeds=0\n")
375375
f.write("listenonion=0\n")
376+
# Increase peertimeout to avoid disconnects while using mocktime.
377+
# peertimeout is measured in wall clock time, so setting it to the
378+
# duration of the longest test is sufficient. It can be overriden in
379+
# tests.
380+
f.write("peertimeout=999999\n")
376381
f.write("printtoconsole=0\n")
377382
f.write("upnp=0\n")
378383
f.write("natpmp=0\n")

0 commit comments

Comments
 (0)