diff --git a/src/init.cpp b/src/init.cpp index d6c224a1013..75d6cf44a88 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -468,7 +468,7 @@ std::string HelpMessage(HelpMessageMode mode) { strUsage += HelpMessageOpt("-printpriority", strprintf("Log transaction priority and fee per kB when mining blocks (default: %u)", DEFAULT_PRINTPRIORITY)); } - strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)")); + strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on startup/SIGHUP (default: 1 when no -debug)")); AppendParamsHelpMessages(strUsage, showDebug); diff --git a/src/util.cpp b/src/util.cpp index 0f7a4db7a46..c189b32f394 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -324,6 +324,10 @@ int LogPrintStr(const std::string &str) // reopen the log file, if requested if (fReopenDebugLog) { fReopenDebugLog = false; + + if (GetBoolArg("-shrinkdebugfile", !fDebug)) { + ShrinkDebugFile(); + } fs::path pathDebug = GetDataDir() / "debug.log"; if (fsbridge::freopen(pathDebug,"a",fileout) != NULL) setbuf(fileout, NULL); // unbuffered