Merge pull request #4354

03c07b16 rpc: return "already mining" in start_mining if already mining (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-09-18 17:56:51 +02:00
commit 9d0565615c
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -779,7 +779,13 @@ namespace cryptonote
boost::thread::attributes attrs; boost::thread::attributes attrs;
attrs.set_stack_size(THREAD_STACK_SIZE); 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"; res.status = "Failed, mining not started";
LOG_PRINT_L0(res.status); LOG_PRINT_L0(res.status);