Skip to content

Commit

Permalink
Log when voting and warn if voting with more than one account (#2489)
Browse files Browse the repository at this point in the history
* Log about voting and the number of representatives configured

* Fix stream

* Clarify stdout message
  • Loading branch information
guilhermelawless authored Jan 20, 2020
1 parent baafd5f commit 71b0f6e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nano/nano_node/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());

Expand Down

0 comments on commit 71b0f6e

Please sign in to comment.