test: Avoid resetting mocktime in testing setup

This allows to set the mocktime before the testing setup.

Also, in some fuzz tests the mocktime was reset to 0 before this change,
so set it.
This commit is contained in:
MarcoFalke
2025-05-07 09:42:32 +02:00
parent fa6b45fa8e
commit fa26bfde98
7 changed files with 9 additions and 3 deletions

View File

@@ -1052,7 +1052,9 @@ bool AppInitParameterInteraction(const ArgsManager& args)
if (!g_wallet_init_interface.ParameterInteraction()) return false;
// Option to startup with mocktime set (used for regression testing):
SetMockTime(args.GetIntArg("-mocktime", 0)); // SetMockTime(0) is a no-op
if (const auto mocktime{args.GetIntArg("-mocktime")}) {
SetMockTime(std::chrono::seconds{*mocktime});
}
if (args.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
g_local_services = ServiceFlags(g_local_services | NODE_BLOOM);