diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -250,10 +250,6 @@ node.connman->Stop(); } -#if ENABLE_CHRONIK - chronik::Stop(); -#endif - StopTorControl(); // After everything has been shut down, but before things get flushed, stop @@ -296,6 +292,10 @@ // generate CValidationInterface callbacks, flush them... GetMainSignals().FlushBackgroundCallbacks(); +#if ENABLE_CHRONIK + chronik::Stop(); +#endif + // Stop and delete all indexes only after flushing background callbacks. if (g_txindex) { g_txindex->Stop();