From 71b0f6ef3569a34de58530b804f5bf65c82782d9 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Mon, 20 Jan 2020 15:16:34 +0000 Subject: [PATCH] Log when voting and warn if voting with more than one account (#2489) * Log about voting and the number of representatives configured * Fix stream * Clarify stdout message --- nano/nano_node/daemon.cpp | 6 +++++- nano/node/node.cpp | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/nano/nano_node/daemon.cpp b/nano/nano_node/daemon.cpp index f6eb89ed..5090aa5d 100644 --- a/nano/nano_node/daemon.cpp +++ b/nano/nano_node/daemon.cpp @@ -62,7 +62,11 @@ void nano_daemon::daemon::run (boost::filesystem::path const & data_path, nano:: << "Path: " << node->application_path.string () << "\n" << "Build Info: " << BUILD_INFO << "\n" << "Database backend: " << node->store.vendor_get () << std::endl; - + auto voting (node->wallets.rep_counts ().voting); + if (voting > 1) + { + std::cout << "Voting with more than one representative can limit performance: " << voting << " representatives are configured" << std::endl; + } node->start (); nano::ipc::ipc_server ipc_server (*node, config.rpc); #if BOOST_PROCESS_SUPPORTED diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 141bbe5b..cfaf433c 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -382,6 +382,22 @@ startup_time (std::chrono::steady_clock::now ()) std::exit (1); } + if (config.enable_voting) + { + std::ostringstream stream; + stream << "Voting is enabled, more system resources will be used"; + auto voting (wallets.rep_counts ().voting); + if (voting > 0) + { + stream << ". " << voting << " representative(s) are configured"; + if (voting > 1) + { + stream << ". Voting with more than one representative can limit performance"; + } + } + logger.always_log (stream.str ()); + } + node_id = nano::keypair (); logger.always_log ("Node ID: ", node_id.pub.to_node_id ());