diff --git a/src/coins.h b/src/coins.h index 6e8643ccc25..5bf4c07e7af 100644 --- a/src/coins.h +++ b/src/coins.h @@ -733,6 +733,10 @@ public: CCoinsViewCache::Flush(reallocate_cache); } + //! Swapping the backend or writing through to it with Sync() is not supported while fetching. + void SetBackend(CCoinsView&) = delete; + void Sync() = delete; + //! Verify that all parallel fetched input prevouts have been consumed. bool AllInputsConsumed() const noexcept { return m_input_tail == m_inputs.size(); } }; diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp index 5e1b08ade52..343eb993f0d 100644 --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -204,7 +204,7 @@ void TestCoinsView(FuzzedDataProvider& fuzzed_data_provider, CCoinsViewCache& co coins_view_cache.Uncache(random_out_point); }, [&] { - if (overlay) return; // // CoinsViewOverlay::SetBackend() is never called in production code + if (overlay) return; // CoinsViewOverlay::SetBackend() is never called in production code const bool use_original_backend{fuzzed_data_provider.ConsumeBool()}; if (use_original_backend && backend_coins_view != original_backend) { // FRESH flags valid against the empty backend may be invalid @@ -382,7 +382,7 @@ void TestCoinsView(FuzzedDataProvider& fuzzed_data_provider, CCoinsViewCache& co // If HaveCoin on the backend is true, it must also be on the cache if the coin wasn't spent. std::optional coin_in_backend; bool exists_using_have_coin_in_backend; - if (dynamic_cast(&coins_view_cache)) { + if (overlay) { // PeekCoin does not mutate cacheCoins, so async workers can keep running. coin_in_backend = backend_coins_view->PeekCoin(random_out_point); exists_using_have_coin_in_backend = coin_in_backend.has_value();