aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-11-14 21:32:09 +0200
committerRiccardo Spagni <ric@spagni.net>2018-11-14 21:32:10 +0200
commitff347c98a1f195073a21b0feb199d36c7760610f (patch)
tree3e4bcf828100baa8b7004c9614c96fecc11e7d1f /src/rpc
parentMerge pull request #4746 (diff)
parentreturn message in stop_mining if mining never started (diff)
downloadmonero-ff347c98a1f195073a21b0feb199d36c7760610f.tar.xz
Merge pull request #4747
dad5bbfd return message in stop_mining if mining never started (cryptochangements34)
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6c1972a3f..4e0b2ed15 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -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);