diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-07-15 10:22:27 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-07-15 10:26:44 +0200 |
| commit | 96ff9d64037bba25c080b4f26e64e7f01c6f34f1 (patch) | |
| tree | f712605e533b91ad26b22cd7f16248dac9c79b92 /src/util.cpp | |
| parent | Merge pull request #4505 (diff) | |
| download | discoin-96ff9d64037bba25c080b4f26e64e7f01c6f34f1.tar.xz discoin-96ff9d64037bba25c080b4f26e64e7f01c6f34f1.zip | |
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`.
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index ce31619ec..d3fa5182f 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); |