aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authorDion Ahmetaj <Dion Ahmetaj>2017-02-15 14:00:01 -0500
committerDion Ahmetaj <Dion Ahmetaj>2017-02-16 14:35:01 -0500
commit69ab14d91e67fdf242b00c83ab85ce280e55f6f4 (patch)
tree2f6ebdf501907f94f5cbd1f23adcbf65fad2de83 /src/daemon/command_parser_executor.cpp
parentMerge pull request #1719 (diff)
downloadmonero-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/daemon/command_parser_executor.cpp')
-rw-r--r--src/daemon/command_parser_executor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index 8ed529737..e5fa5fece 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -272,12 +272,18 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
std::cout << "Mining to a testnet address, make sure this is intentional!" << std::endl;
uint64_t threads_count = 1;
bool do_background_mining = false;
- if(args.size() > 3)
+ bool ignore_battery = false;
+ if(args.size() > 4)
{
return false;
}
- if(args.size() == 3)
+ if(args.size() == 4)
+ {
+ ignore_battery = args[3] == "true";
+ }
+
+ if(args.size() >= 3)
{
do_background_mining = args[2] == "true";
}
@@ -288,7 +294,7 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
threads_count = (ok && 0 < threads_count) ? threads_count : 1;
}
- m_executor.start_mining(adr, threads_count, testnet, do_background_mining);
+ m_executor.start_mining(adr, threads_count, testnet, do_background_mining, ignore_battery);
return true;
}