mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
Remove PID file at the very end
This commit is contained in:
16
src/init.cpp
16
src/init.cpp
@ -278,13 +278,6 @@ void Shutdown(NodeContext& node)
|
|||||||
}
|
}
|
||||||
#endif
|
#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();
|
node.chain_clients.clear();
|
||||||
UnregisterAllValidationInterfaces();
|
UnregisterAllValidationInterfaces();
|
||||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||||
@ -292,6 +285,15 @@ void Shutdown(NodeContext& node)
|
|||||||
ECC_Stop();
|
ECC_Stop();
|
||||||
if (node.mempool) node.mempool = nullptr;
|
if (node.mempool) node.mempool = nullptr;
|
||||||
node.scheduler.reset();
|
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__);
|
LogPrintf("%s: done\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user