diff options
author | cryptochangements34 <bevanoffr@gmail.com> | 2018-10-28 09:50:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-28 09:50:33 -0400 |
commit | dad5bbfdf9597eb699f70c209c286b4c48cb1bd8 (patch) | |
tree | 80016e4e1b51a766e6a3d103c2cb2a6f87c30036 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #4721 (diff) | |
download | monero-dad5bbfdf9597eb699f70c209c286b4c48cb1bd8.tar.xz |
return message in stop_mining if mining never started
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index aa9d3d64b..acce2d5d0 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -801,7 +801,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); |