aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-06-20 14:09:42 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-06-20 14:09:42 -0500
commit36aeaa7545b3c57ee8d439bae6768ce18a76a6d0 (patch)
tree6538141cde7a7b2cd5f2f7bbf32394bdb33244ed
parentMerge pull request #3880 (diff)
parenthandle optional miner params better (diff)
downloadmonero-36aeaa7545b3c57ee8d439bae6768ce18a76a6d0.tar.xz
Merge pull request #3757
6f9260e handle optional miner params better (cryptochangements34)
-rw-r--r--src/cryptonote_basic/miner.cpp5
-rw-r--r--src/daemon/command_parser_executor.cpp19
2 files changed, 22 insertions, 2 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index 2c777f5a2..3a3222f9b 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -328,6 +328,11 @@ namespace cryptonote
LOG_PRINT_L0("Background mining controller thread started" );
}
+ if(get_ignore_battery())
+ {
+ MINFO("Ignoring battery");
+ }
+
return true;
}
//-----------------------------------------------------------------------------------------------------
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp
index 34d9fb4c8..aa688294d 100644
--- a/src/daemon/command_parser_executor.cpp
+++ b/src/daemon/command_parser_executor.cpp
@@ -27,6 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "common/dns_utils.h"
+#include "common/command_line.h"
#include "version.h"
#include "daemon/command_parser_executor.h"
@@ -326,12 +327,26 @@ bool t_command_parser_executor::start_mining(const std::vector<std::string>& arg
if(args.size() == 4)
{
- ignore_battery = args[3] == "true";
+ if(args[3] == "true" || command_line::is_yes(args[3]) || args[3] == "1")
+ {
+ ignore_battery = true;
+ }
+ else if(args[3] != "false" && !command_line::is_no(args[3]) && args[3] != "0")
+ {
+ return false;
+ }
}
if(args.size() >= 3)
{
- do_background_mining = args[2] == "true";
+ if(args[2] == "true" || command_line::is_yes(args[2]) || args[2] == "1")
+ {
+ do_background_mining = true;
+ }
+ else if(args[2] != "false" && !command_line::is_no(args[2]) && args[2] != "0")
+ {
+ return false;
+ }
}
if(args.size() >= 2)