nit: I would go further and merge it with the above docstring. IIUC correctly, they all talk about L349?
<details>
<summary>git diff on 7a37f20083</summary>
diff --git a/src/init.cpp b/src/init.cpp
index 695e365867..b558a1594d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -344,16 +344,17 @@ void Shutdown(NodeContext& node)
}
}
- // After there are no more peers/RPC left to give us new data which may generate
- // CValidationInterface callbacks, flush them...
+ // After there are no more peers/RPC left to give us new data which
+ // may generate CValidationInterface callbacks, flush them. 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 flush is to let
+ // the wallet and indexes catch up with our current chain to avoid
+ // any strange pruning edge cases and make next startup faster by
+ // avoiding rescan.
if (node.validation_signals) node.validation_signals->FlushBackgroundCallbacks();
- // 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 wallet and indexes catch up with our current chain to avoid any
- // strange pruning edge cases and make next startup faster by avoiding
- // rescan.
+
// Stop and delete all indexes only after flushing background callbacks.
for (auto* index : node.indexes) index->Stop();
</details>