aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authorDion Ahmetaj <Dion Ahmetaj>2017-01-14 22:20:54 -0500
committerDion Ahmetaj <Dion Ahmetaj>2017-02-10 18:07:39 -0500
commit345ed4823c686edda33e224316c5ade8a5b838ae (patch)
tree7d113167a22dc88069142584cc32f42202a9ce52 /src/daemon/rpc_command_executor.cpp
parentMerge pull request #1698 (diff)
downloadmonero-345ed4823c686edda33e224316c5ade8a5b838ae.tar.xz
Background/smart mining. If a users' computer is plugged into a power
source, and CPU has been idle for some time, then begin mining to some threshold (don't destroy the users' CPU). This patch only supports windows and linux (I've only tested on Win64 and Ubuntu). The variables currently default to pretty conservative values (i.e. 20% CPU mining threshold).
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r--src/daemon/rpc_command_executor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 469f83014..ae5c2d31d 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -929,11 +929,12 @@ bool t_rpc_command_executor::print_transaction_pool_stats() {
return true;
}
-bool t_rpc_command_executor::start_mining(cryptonote::account_public_address address, uint64_t num_threads, bool testnet) {
+bool t_rpc_command_executor::start_mining(cryptonote::account_public_address address, uint64_t num_threads, bool testnet, bool do_background_mining = false) {
cryptonote::COMMAND_RPC_START_MINING::request req;
cryptonote::COMMAND_RPC_START_MINING::response res;
req.miner_address = cryptonote::get_account_address_as_str(testnet, address);
req.threads_count = num_threads;
+ req.do_background_mining = do_background_mining;
std::string fail_message = "Mining did not start";