From fa8fe0941edfe515cb491e970371f8f84d2d8cdc Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 20 Mar 2026 10:37:35 +0100 Subject: [PATCH] fuzz: Use NodeClockContext This refactor is a follow-up to commit eeeeb2a0b902ed69b5cd5523833d3ab5d963c81f and does not change any behavior. However, it is nice to know that no global mocktime leaks from the fuzz init step to the first fuzz input, or from one fuzz input execution to the next. With the clock context, the global is re-set at the end of the context. --- src/wallet/test/fuzz/scriptpubkeyman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/test/fuzz/scriptpubkeyman.cpp b/src/wallet/test/fuzz/scriptpubkeyman.cpp index a627c770541..fa8bc250d07 100644 --- a/src/wallet/test/fuzz/scriptpubkeyman.cpp +++ b/src/wallet/test/fuzz/scriptpubkeyman.cpp @@ -205,7 +205,7 @@ FUZZ_TARGET(spkm_migration, .init = initialize_spkm_migration) { SeedRandomStateForTest(SeedRand::ZEROS); FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()}; - SetMockTime(ConsumeTime(fuzzed_data_provider)); + NodeClockContext clock_ctx{ConsumeTime(fuzzed_data_provider)}; const auto& node{g_setup->m_node}; Chainstate& chainstate{node.chainman->ActiveChainstate()};