p2p: Make timeout mockable and type safe, speed up test

This commit is contained in:
MarcoFalke committed 2021-12-06 10:47:52 +01:00
1 parent fa6d5a238d
commit fadc0c80ae
12 files changed
+62 -54

No files matched your search

+4 -4
View File
@@ -378,10 +378,10 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
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 overridden in
# tests.
f.write("peertimeout=999999\n")
# peertimeout is measured in mock time, so setting it large enough to
# cover any duration in mock time is sufficient. It can be overridden
# in tests.
f.write("peertimeout=999999999\n")
f.write("printtoconsole=0\n")
f.write("upnp=0\n")
f.write("natpmp=0\n")