mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
Can't log to debug log before chain params initialized
Add a function `AreBaseParamsConfigured` and use this to check before writing to the debug log. This avoids assertions when the application happens to log too early, which happens in the GUI. Messages logged before the base parameters are configured can be shown using `-printtoconsole`.
This commit is contained in:
@@ -205,7 +205,7 @@ int LogPrintStr(const std::string &str)
|
||||
// print to console
|
||||
ret = fwrite(str.data(), 1, str.size(), stdout);
|
||||
}
|
||||
else if (fPrintToDebugLog)
|
||||
else if (fPrintToDebugLog && AreBaseParamsConfigured())
|
||||
{
|
||||
static bool fStartedNewLine = true;
|
||||
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
|
||||
|
||||
Reference in New Issue
Block a user