diff --git a/src/init.cpp b/src/init.cpp index 34403e3c1..776699fa9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -211,9 +211,9 @@ void Shutdown() /// for example if the data directory was found to be locked. /// Be sure that anything that writes files or flushes caches only does this if the respective /// module was initialized. - static char shutoffstr[128]; - sprintf(shutoffstr,"%s-shutoff","hush"); - RenameThread(shutoffstr); + // Do not RenameThread() here: Shutdown() runs on the main thread, whose name is the process name + // (/proc//comm). Renaming it made 'pgrep -x dragonxd' stop matching a node that was still + // shutting down and holding its locks, so pgrep-based restart scripts relaunched it too early. mempool.AddTransactionsUpdated(1); if(fDebug) {