merge bitcoin#22960: Set peertimeout in write_config

This commit is contained in:
Kittywhiskers Van Gogh 2024-03-25 11:05:21 +00:00
parent 06e909b737
commit 45d9e58023
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
3 changed files with 6 additions and 5 deletions

View File

@ -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"],
]

View File

@ -38,7 +38,6 @@ class MaxUploadTest(BitcoinTestFramework):
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"
]]

View File

@ -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")