diff --git a/src/main.cpp b/src/main.cpp index c21448997..4667236ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3094,8 +3094,9 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin fExpensiveChecks = false; } - // Don't cache results if we're actually connecting blocks (still consult the cache, though). - bool fCacheResults = fJustCheck; + // Don't cache results if we're actually connecting blocks or benchmarking + // (still consult the cache, though, which will be empty for benchmarks). + bool fCacheResults = fJustCheck && (blockChecks != CheckAs::SlowBenchmark); // proof verification is expensive, disable if possible auto verifier = fExpensiveChecks ? ProofVerifier::Strict() : ProofVerifier::Disabled(); diff --git a/src/zcbenchmarks.cpp b/src/zcbenchmarks.cpp index 8ed2b907a..7c508e353 100644 --- a/src/zcbenchmarks.cpp +++ b/src/zcbenchmarks.cpp @@ -594,7 +594,7 @@ double benchmark_connectblock_slow() CValidationState state; struct timeval tv_start; timer_start(tv_start); - assert(ConnectBlock(block, state, &index, view, Params(), true)); + assert(ConnectBlock(block, state, &index, view, Params(), true, CheckAs::SlowBenchmark)); auto duration = timer_stop(tv_start); // Undo alterations to global state