From 96ff9d64037bba25c080b4f26e64e7f01c6f34f1 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 15 Jul 2014 10:22:27 +0200 Subject: 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`. --- src/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index ce31619eca..d3fa5182f3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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); -- cgit v1.2.3