Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115436
D8663.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D8663.diff
View Options
diff --git a/src/init.cpp b/src/init.cpp
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -229,10 +229,6 @@
LOCK2(::cs_main, ::g_cs_orphans);
node.connman->StopNodes();
}
- if (g_txindex) {
- g_txindex->Stop();
- }
- ForEachBlockFilterIndex([](BlockFilterIndex &index) { index.Stop(); });
StopTorControl();
@@ -252,8 +248,6 @@
g_avalanche.reset();
node.connman.reset();
node.banman.reset();
- g_txindex.reset();
- DestroyAllBlockFilterIndexes();
if (::g_mempool.IsLoaded() &&
node.args->GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
@@ -275,6 +269,14 @@
// generate CValidationInterface callbacks, flush them...
GetMainSignals().FlushBackgroundCallbacks();
+ // Stop and delete all indexes only after flushing background callbacks.
+ if (g_txindex) {
+ g_txindex->Stop();
+ g_txindex.reset();
+ }
+ ForEachBlockFilterIndex([](BlockFilterIndex &index) { index.Stop(); });
+ DestroyAllBlockFilterIndexes();
+
// Any future callbacks will be dropped. This should absolutely be safe - if
// missing a callback results in an unrecoverable situation, unclean
// shutdown would too. The only reason to do the above flushes is to let the
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:05 (19 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187494
Default Alt Text
D8663.diff (1 KB)
Attached To
D8663: init: Stop indexes on shutdown after ChainStateFlushed callback.
Event Timeline
Log In to Comment