summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <fireice-uk@users.noreply.github.com>2017-12-07 15:06:49 +0000
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-12-08 11:35:18 +0000
commitc4ae72ecfb09218171197dba012ce485b5cfc222 (patch)
treeafb449279a675f78c6b2adc7e848232f30bc9bdd
parentb0f17cffc8a353db96bc9c8438330d90f63cbf72 (diff)
downloadxmr-stak-c4ae72ecfb09218171197dba012ce485b5cfc222.zip
xmr-stak-c4ae72ecfb09218171197dba012ce485b5cfc222.tar.gz
Add --use-nicehash option
-rw-r--r--xmrstak/cli/cli-miner.cpp7
-rw-r--r--xmrstak/misc/executor.cpp5
-rw-r--r--xmrstak/params.hpp1
3 files changed, 10 insertions, 3 deletions
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"<<endl;
cout<<" -u, --user USERNAME pool user name or wallet address"<<endl;
cout<<" -p, --pass PASSWD pool password, in the most cases x or empty \"\""<<endl;
+ cout<<" --use-nicehash the pool should run in nicehash mode"<<endl;
cout<<" \n"<<endl;
#ifdef _WIN32
cout<<"Environment variables:\n"<<endl;
@@ -260,7 +261,7 @@ void do_guided_config()
nicehash = read_yes_no("- Do you want to use nicehash on this pool? (y/n)");
}
else
- nicehash = false;
+ nicehash = params::inst().nicehashMode;
bool multipool;
if(!userSetPool)
@@ -499,6 +500,10 @@ int main(int argc, char *argv[])
params::inst().userSetPwd = true;
params::inst().poolPasswd = argv[i];
}
+ else if(opName.compare("--use-nicehash") == 0)
+ {
+ params::inst().nicehashMode = true;
+ }
else if(opName.compare("-c") == 0 || opName.compare("--config") == 0)
{
++i;
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index abeb3e2..e2ce715 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -520,8 +520,9 @@ void executor::ex_main()
const char* wallet = params.poolUsername.empty() ? cfg.sWalletAddr : params.poolUsername.c_str();
const char* pwd = params.userSetPwd ? params.poolPasswd.c_str() : cfg.sPasswd;
+ bool nicehash = cfg.nicehash || params.nicehashMode;
- pools.emplace_back(i+1, cfg.sPoolAddr, wallet, pwd, 9.9, false, params.poolUseTls, cfg.tls_fingerprint, cfg.nicehash);
+ pools.emplace_back(i+1, cfg.sPoolAddr, wallet, pwd, 9.9, false, params.poolUseTls, cfg.tls_fingerprint, nicehash);
}
else
pools.emplace_back(i+1, cfg.sPoolAddr, cfg.sWalletAddr, cfg.sPasswd, cfg.weight, false, cfg.tls, cfg.tls_fingerprint, cfg.nicehash);
@@ -530,7 +531,7 @@ void executor::ex_main()
if(!xmrstak::params::inst().poolURL.empty() && !already_have_cli_pool)
{
auto& params = xmrstak::params::inst();
- pools.emplace_front(i+1, params.poolURL.c_str(), params.poolUsername.c_str(), params.poolPasswd.c_str(), 9.9, false, params.poolUseTls, "", false);
+ pools.emplace_front(i+1, params.poolURL.c_str(), params.poolUsername.c_str(), params.poolPasswd.c_str(), 9.9, false, params.poolUseTls, "", params.nicehashMode);
}
if(jconf::inst()->IsCurrencyMonero())
diff --git a/xmrstak/params.hpp b/xmrstak/params.hpp
index 371a4fd..bc32612 100644
--- a/xmrstak/params.hpp
+++ b/xmrstak/params.hpp
@@ -29,6 +29,7 @@ struct params
bool userSetPwd = false;
std::string poolPasswd;
std::string poolUsername;
+ bool nicehashMode = false;
std::string currency;
OpenPOWER on IntegriCloud