Remove PID file at the very end

This commit is contained in:
Hennadii Stepanov 2020-04-04 22:50:40 +03:00
parent c8971547d9
commit 7fcdec0f32
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -278,13 +278,6 @@ void Shutdown(NodeContext& node)
}
#endif
try {
if (!fs::remove(GetPidFile())) {
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
}
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
}
node.chain_clients.clear();
UnregisterAllValidationInterfaces();
GetMainSignals().UnregisterBackgroundSignalScheduler();
@ -292,6 +285,15 @@ void Shutdown(NodeContext& node)
ECC_Stop();
if (node.mempool) node.mempool = nullptr;
node.scheduler.reset();
try {
if (!fs::remove(GetPidFile())) {
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
}
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
}
LogPrintf("%s: done\n", __func__);
}