diff --git a/src/test/baseindex_tests.cpp b/src/test/baseindex_tests.cpp index 68907ad28d8..63f3c912f2a 100644 --- a/src/test/baseindex_tests.cpp +++ b/src/test/baseindex_tests.cpp @@ -230,6 +230,10 @@ BOOST_FIXTURE_TEST_CASE(index_reorg_crash, TestChain100Setup) promise.set_value(); // Wait for the index to reach the new tip func_wait_until(blocking_height + 2, 5s); + + // Drain unused BlockConnected events, to avoid unsafe memory races during destruction + m_node.chain->context()->validation_signals->SyncWithValidationInterfaceQueue(); + // shutdown sequence (c.f. Shutdown() in init.cpp) index.Stop(); }