Merge pull request #4747

dad5bbfd return message in stop_mining if mining never started (cryptochangements34)
This commit is contained in:
Riccardo Spagni 2018-11-14 21:32:09 +02:00
commit ff347c98a1
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -802,7 +802,14 @@ namespace cryptonote
bool core_rpc_server::on_stop_mining(const COMMAND_RPC_STOP_MINING::request& req, COMMAND_RPC_STOP_MINING::response& res)
{
PERF_TIMER(on_stop_mining);
if(!m_core.get_miner().stop())
cryptonote::miner &miner= m_core.get_miner();
if(!miner.is_mining())
{
res.status = "Mining never started";
LOG_PRINT_L0(res.status);
return true;
}
if(!miner.stop())
{
res.status = "Failed, mining not stopped";
LOG_PRINT_L0(res.status);