Console: don't listen on a TCP port when local API is not enabled

This commit is contained in:
SChernykh
2025-06-10 22:11:26 +02:00
parent 17279708e5
commit 2fe5dd8a36
+1 -1
View File
@@ -84,6 +84,7 @@ ConsoleCommands::ConsoleCommands(p2pool* pool)
} }
} }
if (m_pool->api() && m_pool->params().m_localStats) {
std::mt19937_64 rng(RandomDeviceSeed::instance); std::mt19937_64 rng(RandomDeviceSeed::instance);
// Diffuse the initial state in case it has low quality // Diffuse the initial state in case it has low quality
@@ -107,7 +108,6 @@ ConsoleCommands::ConsoleCommands(p2pool* pool)
c = static_cast<char>(rng() % (127 - 32) + 32); c = static_cast<char>(rng() % (127 - 32) + 32);
} }
if (m_pool->api() && m_pool->params().m_localStats) {
m_pool->api()->set(p2pool_api::Category::LOCAL, "console", m_pool->api()->set(p2pool_api::Category::LOCAL, "console",
[stdin_type, this](log::Stream& s) [stdin_type, this](log::Stream& s)
{ {