mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 08:07:33 +02:00
fuzz: Use NodeClockContext
This refactor is a follow-up to commit
eeeeb2a0b9 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.
This commit is contained in:
@@ -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()};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user