Skip to content

Commit

Permalink
merge bitcoin#22960: Set peertimeout in write_config
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Apr 12, 2024
1 parent 06e909b commit 45d9e58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class BIP68Test(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [
[
"-acceptnonstdtxn=1",
"-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise
],
["-acceptnonstdtxn=1"],
["-acceptnonstdtxn=0"],
]

Expand Down
1 change: 0 additions & 1 deletion test/functional/feature_maxuploadtarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def set_test_params(self):
self.extra_args = [[
"-maxuploadtarget=200",
"-blockmaxsize=999000",
"-peertimeout=9999", # bump because mocktime might cause a disconnect otherwise
"-maxtipage="+str(2*60*60*24*7),
"-acceptnonstdtxn=1"
]]
Expand Down
5 changes: 5 additions & 0 deletions test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ def write_config(config_path, *, n, chain, extra_config=""):
f.write("dnsseed=0\n")
f.write("fixedseeds=0\n")
f.write("listenonion=0\n")
# Increase peertimeout to avoid disconnects while using mocktime.
# peertimeout is measured in wall clock time, so setting it to the
# duration of the longest test is sufficient. It can be overriden in
# tests.
f.write("peertimeout=999999\n")
f.write("printtoconsole=0\n")
f.write("upnp=0\n")
f.write("natpmp=0\n")
Expand Down

0 comments on commit 45d9e58

Please sign in to comment.