diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -27,6 +27,7 @@ #include namespace { +const TestingSetup *g_setup; const Coin EMPTY_COIN{}; bool operator==(const Coin &a, const Coin &b) { @@ -40,6 +41,7 @@ void initialize() { static const auto testing_setup = MakeFuzzingContext(); + g_setup = testing_setup.get(); } void test_one_input(const std::vector &buffer) { @@ -303,7 +305,8 @@ (void)GetUTXOStats( &coins_view_cache, WITH_LOCK(::cs_main, - return std::ref(g_chainman.m_blockman)), + return std::ref( + g_setup->m_node.chainman->m_blockman)), stats); } catch (const std::logic_error &) { expected_code_path = true; diff --git a/src/test/fuzz/load_external_block_file.cpp b/src/test/fuzz/load_external_block_file.cpp --- a/src/test/fuzz/load_external_block_file.cpp +++ b/src/test/fuzz/load_external_block_file.cpp @@ -14,8 +14,13 @@ #include #include +namespace { +const TestingSetup *g_setup; +} // namespace + void initialize() { static const auto testing_setup = MakeFuzzingContext(); + g_setup = testing_setup.get(); } void test_one_input(const std::vector &buffer) { @@ -26,7 +31,7 @@ return; } FlatFilePos flat_file_pos; - ::ChainstateActive().LoadExternalBlockFile( + g_setup->m_node.chainman->ActiveChainstate().LoadExternalBlockFile( GetConfig(), fuzzed_block_file, fuzzed_data_provider.ConsumeBool() ? &flat_file_pos : nullptr); }