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
This commit is contained in:
Guilherme Lawless 2020-01-20 15:16:34 +00:00 committed by GitHub
commit 71b0f6ef35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -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

View file

@ -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 ());