mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 17:32:33 +00:00
rpc: return "already mining" in start_mining if already mining
This commit is contained in:
parent
fad88e18a9
commit
03c07b167d
1 changed files with 7 additions and 1 deletions
|
@ -850,7 +850,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);
|
||||||
|
|
Loading…
Reference in a new issue