File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -256,12 +256,8 @@ void Interrupt(NodeContext& node)
256256 InterruptMapPort ();
257257 if (node.connman )
258258 node.connman ->Interrupt ();
259- if (g_txindex) {
260- g_txindex->Interrupt ();
261- }
262- ForEachBlockFilterIndex ([](BlockFilterIndex& index) { index.Interrupt (); });
263- if (g_coin_stats_index) {
264- g_coin_stats_index->Interrupt ();
259+ for (auto * index : node.indexes ) {
260+ index->Interrupt ();
265261 }
266262}
267263
@@ -337,16 +333,11 @@ void Shutdown(NodeContext& node)
337333 if (node.validation_signals ) node.validation_signals ->FlushBackgroundCallbacks ();
338334
339335 // Stop and delete all indexes only after flushing background callbacks.
340- if (g_txindex) {
341- g_txindex->Stop ();
342- g_txindex.reset ();
343- }
344- if (g_coin_stats_index) {
345- g_coin_stats_index->Stop ();
346- g_coin_stats_index.reset ();
347- }
348- ForEachBlockFilterIndex ([](BlockFilterIndex& index) { index.Stop (); });
336+ for (auto * index : node.indexes ) index->Stop ();
337+ if (g_txindex) g_txindex.reset ();
338+ if (g_coin_stats_index) g_coin_stats_index.reset ();
349339 DestroyAllBlockFilterIndexes ();
340+ node.indexes .clear (); // all instances are nullptr now
350341
351342 // Any future callbacks will be dropped. This should absolutely be safe - if
352343 // missing a callback results in an unrecoverable situation, unclean shutdown
You can’t perform that action at this time.
0 commit comments