aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-04-10 10:07:51 +0200
committerRiccardo Spagni <ric@spagni.net>2015-04-10 10:08:30 +0200
commit277a207b2fb21558aeb06acc3a3e0f218d01ca41 (patch)
tree737f083e24db0c32959f38f2352cdb57ae3788ca /src/daemon/rpc_command_executor.cpp
parentfixed static windows makefile targets (diff)
parentFixes start_mining in cli interactive mode (diff)
downloadmonero-277a207b2fb21558aeb06acc3a3e0f218d01ca41.tar.xz
Merge pull request #259
5b01493 Fixes start_mining in cli interactive mode (Thomas Winget)
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r--src/daemon/rpc_command_executor.cpp18
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;
}