shutdown: Destroy kernel last

Currently the shutdown function resets the kernel before the
chainman and scheduler. Invert this order by resetting the kernel
last, since they might rely on the kernel.
This commit is contained in:
TheCharlatan
2023-10-24 08:37:12 +02:00
parent 44b05bf3fe
commit 9759af17ff

View File

@@ -341,11 +341,11 @@ void Shutdown(NodeContext& node)
node.chain_clients.clear(); node.chain_clients.clear();
UnregisterAllValidationInterfaces(); UnregisterAllValidationInterfaces();
GetMainSignals().UnregisterBackgroundSignalScheduler(); GetMainSignals().UnregisterBackgroundSignalScheduler();
node.kernel.reset();
node.mempool.reset(); node.mempool.reset();
node.fee_estimator.reset(); node.fee_estimator.reset();
node.chainman.reset(); node.chainman.reset();
node.scheduler.reset(); node.scheduler.reset();
node.kernel.reset();
try { try {
if (!fs::remove(GetPidFile(*node.args))) { if (!fs::remove(GetPidFile(*node.args))) {