aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chainparamsbase.cpp4
-rw-r--r--src/chainparamsbase.h6
-rw-r--r--src/util.cpp2
3 files changed, 11 insertions, 1 deletions
diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp
index 19a9e72cc9..720e24c4a8 100644
--- a/src/chainparamsbase.cpp
+++ b/src/chainparamsbase.cpp
@@ -91,3 +91,7 @@ bool SelectBaseParamsFromCommandLine() {
}
return true;
}
+
+bool AreBaseParamsConfigured() {
+ return pCurrentBaseParams != NULL;
+}
diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h
index 4a3b268909..4398f69548 100644
--- a/src/chainparamsbase.h
+++ b/src/chainparamsbase.h
@@ -49,4 +49,10 @@ void SelectBaseParams(CBaseChainParams::Network network);
*/
bool SelectBaseParamsFromCommandLine();
+/**
+ * Return true if SelectBaseParamsFromCommandLine() has been called to select
+ * a network.
+ */
+bool AreBaseParamsConfigured();
+
#endif
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);