From 42383a28903c270e2ab718c7bdb1111c82d72310 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 7 Dec 2017 12:17:12 +0000 Subject: Allow pool settings to be fully set from CLI options --- xmrstak/cli/cli-miner.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) (limited to 'xmrstak/cli/cli-miner.cpp') diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 546d226..3c3303e 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -87,6 +87,7 @@ void help() cout<<" "<> userName; } @@ -214,18 +231,35 @@ void do_guided_config(bool userSetPasswd) auto& passwd = params::inst().poolPasswd; if(passwd.empty() && (!userSetPasswd)) { + prompt_once(prompted); + // clear everything from stdin to allow an empty password std::cin.clear(); std::cin.ignore(INT_MAX,'\n'); std::cout<<"- Password (mostly empty or x):"<=argc ) + { + printer::inst()->print_msg(L0, "No argument for parameter '-O/--tls-url' given"); + win_exit(); + return 1; + } + params::inst().poolURL = argv[i]; + params::inst().poolUseTls = true; } else if(opName.compare("-u") == 0 || opName.compare("--user") == 0) { -- cgit v1.1 From b0f17cffc8a353db96bc9c8438330d90f63cbf72 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 7 Dec 2017 14:46:02 +0000 Subject: Fix CLI option start + make cli option pool into an added pool with top priority ithinstead of overwrite --- xmrstak/cli/cli-miner.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xmrstak/cli/cli-miner.cpp') diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 3c3303e..639a28e 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -85,7 +85,8 @@ void help() cout<<" --nvidia FILE NVIDIA backend miner config file"<parse_config(params::inst().configFile.c_str())) { -- cgit v1.1 From c4ae72ecfb09218171197dba012ce485b5cfc222 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 7 Dec 2017 15:06:49 +0000 Subject: Add --use-nicehash option --- xmrstak/cli/cli-miner.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xmrstak/cli/cli-miner.cpp') diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 639a28e..be9b917 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -91,6 +91,7 @@ void help() cout<<" -O, --tls-url URL TLS pool url and port, e.g. pool.usxmrpool.com:10443"< Date: Thu, 7 Dec 2017 15:30:15 +0000 Subject: Disallow sending of username / pass to unspecifed pool --- xmrstak/cli/cli-miner.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xmrstak/cli/cli-miner.cpp') diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index be9b917..2c44ffc 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -479,6 +479,13 @@ int main(int argc, char *argv[]) } else if(opName.compare("-u") == 0 || opName.compare("--user") == 0) { + if(params::inst().poolURL.empty()) + { + printer::inst()->print_msg(L0, "Pool address has to be set if you want to specify username and password."); + win_exit(); + return 1; + } + ++i; if( i >=argc ) { @@ -490,6 +497,13 @@ int main(int argc, char *argv[]) } else if(opName.compare("-p") == 0 || opName.compare("--pass") == 0) { + if(params::inst().poolURL.empty()) + { + printer::inst()->print_msg(L0, "Pool address has to be set if you want to specify username and password."); + win_exit(); + return 1; + } + ++i; if( i >=argc ) { -- cgit v1.1 From 78761c5454fe90d66d91e77427b30e57939da7a7 Mon Sep 17 00:00:00 2001 From: fireice-uk Date: Thu, 7 Dec 2017 21:57:41 +0000 Subject: Fix option order --- xmrstak/cli/cli-miner.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'xmrstak/cli/cli-miner.cpp') diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 2c44ffc..6da0855 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -376,7 +376,15 @@ int main(int argc, char *argv[]) } bool uacDialog = true; - for(int i = 1; i < argc; ++i) + bool pool_url_set = false; + for(size_t i = 1; i < argc-1; i++) + { + std::string opName(argv[i]); + if(opName == "-o" || opName == "-O" || opName == "--url" || opName == "--tls-url") + pool_url_set = true; + } + + for(size_t i = 1; i < argc; ++i) { std::string opName(argv[i]); if(opName.compare("-h") == 0 || opName.compare("--help") == 0) @@ -479,7 +487,7 @@ int main(int argc, char *argv[]) } else if(opName.compare("-u") == 0 || opName.compare("--user") == 0) { - if(params::inst().poolURL.empty()) + if(!pool_url_set) { printer::inst()->print_msg(L0, "Pool address has to be set if you want to specify username and password."); win_exit(); @@ -497,7 +505,7 @@ int main(int argc, char *argv[]) } else if(opName.compare("-p") == 0 || opName.compare("--pass") == 0) { - if(params::inst().poolURL.empty()) + if(!pool_url_set) { printer::inst()->print_msg(L0, "Pool address has to be set if you want to specify username and password."); win_exit(); -- cgit v1.1