Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update daemon_commands_handler.h #10

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/daemon/daemon_commands_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class daemon_cmmands_handler
m_cmd_binder.set_handler("show_hr", boost::bind(&daemon_cmmands_handler::show_hr, this, _1), "Start showing hash rate");
m_cmd_binder.set_handler("hide_hr", boost::bind(&daemon_cmmands_handler::hide_hr, this, _1), "Stop showing hash rate");
m_cmd_binder.set_handler("save", boost::bind(&daemon_cmmands_handler::save, this, _1), "Save blockchain");
m_cmd_binder.set_handler("diff", boost::bind(&daemon_cmmands_handler::diff, this, _1), "Show difficulty");
}

bool start_handling()
Expand Down Expand Up @@ -98,6 +99,17 @@ class daemon_cmmands_handler
return true;
}
//--------------------------------------------------------------------------------
bool diff(const std::vector<std::string>& args)
{
cryptonote::difficulty_type difficulty = m_srv.get_payload_object().get_core().get_blockchain_storage().get_difficulty_for_next_block();
uint64_t height = m_srv.get_payload_object().get_core().get_blockchain_storage().get_current_blockchain_height();

LOG_PRINT_GREEN("BH: " << height << ", DIFF: " << difficulty
<< ", HR: " << (int) difficulty / 60L << " H/s", LOG_LEVEL_0);

return true;
}
//--------------------------------------------------------------------------------
bool print_bc_outs(const std::vector<std::string>& args)
{
if(args.size() != 1)
Expand Down