Added stopmining.

This commit is contained in:
Oran Juice 2014-11-08 21:41:43 +05:30
parent ffe1737fef
commit a273353b32
No known key found for this signature in database
GPG Key ID: 71C5AF46CCB28124
1 changed files with 12 additions and 0 deletions

View File

@ -300,11 +300,22 @@ namespace RPC
return ns_rpc_create_reply(buf, len, req, "{s:s}", "status", CORE_RPC_STATUS_OK);
}
int stopmining(char *buf, int len, struct ns_rpc_request *req)
{
CHECK_CORE_BUSY();
if (!core->get_miner().stop())
{
return ns_rpc_create_reply(buf, len, req, "{s:s}", "status", "Failed, mining not stopped");
}
return ns_rpc_create_reply(buf, len, req, "{s:s}", "status", CORE_RPC_STATUS_OK);
}
const char *method_names[] = {
"getheight",
"getblocks",
"gettransactions",
"startmining",
"stopmining",
NULL
};
@ -313,6 +324,7 @@ namespace RPC
getblocks,
gettransactions,
startmining,
stopmining,
NULL
};