mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 03:48:52 +00:00
handle optional miner params better
This commit is contained in:
parent
7ed94d3122
commit
6f9260e38e
@ -328,6 +328,11 @@ namespace cryptonote
|
|||||||
LOG_PRINT_L0("Background mining controller thread started" );
|
LOG_PRINT_L0("Background mining controller thread started" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(get_ignore_battery())
|
||||||
|
{
|
||||||
|
MINFO("Ignoring battery");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "common/dns_utils.h"
|
#include "common/dns_utils.h"
|
||||||
|
#include "common/command_line.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "daemon/command_parser_executor.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)
|
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)
|
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)
|
if(args.size() >= 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user