diff options
author | Thomas Winget <tewinget@gmail.com> | 2015-04-10 04:08:04 -0400 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2015-04-10 04:08:04 -0400 |
commit | 5b0149304798f0e510032ff5fba30dd1a74e4942 (patch) | |
tree | cd6bf24669733820e64121cdd971a2257ec0c2b4 /src/daemon | |
parent | Merge pull request #256 (diff) | |
download | monero-5b0149304798f0e510032ff5fba30dd1a74e4942.tar.xz |
Fixes start_mining in cli interactive mode
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 46900b071..a7c9d2365 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -590,10 +590,24 @@ bool t_rpc_command_executor::start_mining(cryptonote::account_public_address add req.miner_address = cryptonote::get_account_address_as_str(false, address); req.threads_count = num_threads; - if (m_rpc_client->rpc_request(req, res, "/start_mining", "Mining did not start")) + std::string fail_message = "Mining did not start"; + + if (m_is_rpc) + { + if (m_rpc_client->rpc_request(req, res, "/start_mining", fail_message.c_str())) + { + tools::success_msg_writer() << "Mining started"; + } + } + else { - tools::success_msg_writer() << "Mining started"; + if (!m_rpc_server->on_start_mining(req, res)) + { + tools::fail_msg_writer() << fail_message.c_str(); + return true; + } } + return true; } |