diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-06-20 14:09:42 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-06-20 14:09:42 -0500 |
commit | 36aeaa7545b3c57ee8d439bae6768ce18a76a6d0 (patch) | |
tree | 6538141cde7a7b2cd5f2f7bbf32394bdb33244ed /src/daemon | |
parent | Merge pull request #3880 (diff) | |
parent | handle optional miner params better (diff) | |
download | monero-36aeaa7545b3c57ee8d439bae6768ce18a76a6d0.tar.xz |
Merge pull request #3757
6f9260e handle optional miner params better (cryptochangements34)
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
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) |