diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-09 15:26:50 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-09 15:27:30 +0000 |
commit | 03c07b167d2637836c0a5c7dd2994ca158057157 (patch) | |
tree | 2869f79a300a5a55174f5ef3b1465c3a119d0f56 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #4290 (diff) | |
download | monero-03c07b167d2637836c0a5c7dd2994ca158057157.tar.xz |
rpc: return "already mining" in start_mining if already mining
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 0a6daf8f0..d0021a6ef 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -850,7 +850,13 @@ namespace cryptonote boost::thread::attributes attrs; attrs.set_stack_size(THREAD_STACK_SIZE); - if(!m_core.get_miner().start(info.address, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining, req.ignore_battery)) + cryptonote::miner &miner= m_core.get_miner(); + if (miner.is_mining()) + { + res.status = "Already mining"; + return true; + } + if(!miner.start(info.address, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining, req.ignore_battery)) { res.status = "Failed, mining not started"; LOG_PRINT_L0(res.status); |