mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge 0b96a1925e into merged_master (Bitcoin PR bitcoin/bitcoin#28955)
This commit is contained in:
commit
c374a8fdfa
7 changed files with 119 additions and 59 deletions
21
src/init.cpp
21
src/init.cpp
|
|
@ -264,12 +264,8 @@ void Interrupt(NodeContext& node)
|
|||
InterruptMapPort();
|
||||
if (node.connman)
|
||||
node.connman->Interrupt();
|
||||
if (g_txindex) {
|
||||
g_txindex->Interrupt();
|
||||
}
|
||||
ForEachBlockFilterIndex([](BlockFilterIndex& index) { index.Interrupt(); });
|
||||
if (g_coin_stats_index) {
|
||||
g_coin_stats_index->Interrupt();
|
||||
for (auto* index : node.indexes) {
|
||||
index->Interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -346,16 +342,11 @@ void Shutdown(NodeContext& node)
|
|||
if (node.validation_signals) node.validation_signals->FlushBackgroundCallbacks();
|
||||
|
||||
// Stop and delete all indexes only after flushing background callbacks.
|
||||
if (g_txindex) {
|
||||
g_txindex->Stop();
|
||||
g_txindex.reset();
|
||||
}
|
||||
if (g_coin_stats_index) {
|
||||
g_coin_stats_index->Stop();
|
||||
g_coin_stats_index.reset();
|
||||
}
|
||||
ForEachBlockFilterIndex([](BlockFilterIndex& index) { index.Stop(); });
|
||||
for (auto* index : node.indexes) index->Stop();
|
||||
if (g_txindex) g_txindex.reset();
|
||||
if (g_coin_stats_index) g_coin_stats_index.reset();
|
||||
DestroyAllBlockFilterIndexes();
|
||||
node.indexes.clear(); // all instances are nullptr now
|
||||
|
||||
// Any future callbacks will be dropped. This should absolutely be safe - if
|
||||
// missing a callback results in an unrecoverable situation, unclean shutdown
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue