test: Set peertimeout in write_config
This avoids having to remember to set it whenever mocktime is used with peer connections. Also, it might help avoiding disconnects when attaching a debugger to a running test.
This commit is contained in:
4 files changed
+6
-6
No files matched your search
@@ -364,6 +364,11 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
|
||||
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")
|
||||
|
||||
Reference in new issue
Block a user