diff options
author | Dion Ahmetaj <Dion Ahmetaj> | 2017-02-15 14:00:01 -0500 |
---|---|---|
committer | Dion Ahmetaj <Dion Ahmetaj> | 2017-02-16 14:35:01 -0500 |
commit | 69ab14d91e67fdf242b00c83ab85ce280e55f6f4 (patch) | |
tree | 2f6ebdf501907f94f5cbd1f23adcbf65fad2de83 /src/rpc | |
parent | Merge pull request #1719 (diff) | |
download | monero-69ab14d91e67fdf242b00c83ab85ce280e55f6f4.tar.xz |
More robust battery status handling.
Added an extra path to check for linux power supply status.
Added ignore battery option. If set to true, then when we can't figure out
the power status, we'll assume the system is plugged in.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 2 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 8165dacbc..cae6800b5 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -635,7 +635,7 @@ namespace cryptonote boost::thread::attributes attrs; attrs.set_stack_size(THREAD_STACK_SIZE); - if(!m_core.get_miner().start(adr, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining)) + if(!m_core.get_miner().start(adr, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining, req.ignore_battery)) { res.status = "Failed, mining not started"; LOG_PRINT_L0(res.status); diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index 3ab1ea175..8b744c26a 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -501,11 +501,13 @@ namespace cryptonote std::string miner_address; uint64_t threads_count; bool do_background_mining; + bool ignore_battery; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(miner_address) KV_SERIALIZE(threads_count) KV_SERIALIZE(do_background_mining) + KV_SERIALIZE(ignore_battery) END_KV_SERIALIZE_MAP() }; |