mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 10:01:02 +00:00
Merge pull request #259
5b01493
Fixes start_mining in cli interactive mode (Thomas Winget)
This commit is contained in:
commit
277a207b2f
1 changed files with 16 additions and 2 deletions
|
@ -590,10 +590,24 @@ bool t_rpc_command_executor::start_mining(cryptonote::account_public_address add
|
||||||
req.miner_address = cryptonote::get_account_address_as_str(false, address);
|
req.miner_address = cryptonote::get_account_address_as_str(false, address);
|
||||||
req.threads_count = num_threads;
|
req.threads_count = num_threads;
|
||||||
|
|
||||||
if (m_rpc_client->rpc_request(req, res, "/start_mining", "Mining did not start"))
|
std::string fail_message = "Mining did not start";
|
||||||
|
|
||||||
|
if (m_is_rpc)
|
||||||
|
{
|
||||||
|
if (m_rpc_client->rpc_request(req, res, "/start_mining", fail_message.c_str()))
|
||||||
{
|
{
|
||||||
tools::success_msg_writer() << "Mining started";
|
tools::success_msg_writer() << "Mining started";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!m_rpc_server->on_start_mining(req, res))
|
||||||
|
{
|
||||||
|
tools::fail_msg_writer() << fail_message.c_str();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue