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)
256
256
InterruptMapPort ();
257
257
if (node.connman )
258
258
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 ();
265
261
}
266
262
}
267
263
@@ -337,16 +333,11 @@ void Shutdown(NodeContext& node)
337
333
if (node.validation_signals ) node.validation_signals ->FlushBackgroundCallbacks ();
338
334
339
335
// 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 ();
349
339
DestroyAllBlockFilterIndexes ();
340
+ node.indexes .clear (); // all instances are nullptr now
350
341
351
342
// Any future callbacks will be dropped. This should absolutely be safe - if
352
343
// missing a callback results in an unrecoverable situation, unclean shutdown
You can’t perform that action at this time.
0 commit comments