Update configuration

Update configuration flags and fix default donate pool servers (cryptonight and cryptonight-little).
This commit is contained in:
enWILLYado 2018-02-26 20:24:31 +01:00
parent 5d22764a12
commit 668d59705c
5 changed files with 50 additions and 32 deletions

View file

@ -113,7 +113,7 @@ static struct option const options[] =
{ "donate-level", 1, nullptr, 1003 }, { "donate-level", 1, nullptr, 1003 },
{ "dry-run", 0, nullptr, 5000 }, { "dry-run", 0, nullptr, 5000 },
{ "help", 0, nullptr, 'h' }, { "help", 0, nullptr, 'h' },
{ "keepalive", 0, nullptr , 'k' }, { "keepalive", 0, nullptr, 'k' },
{ "log-file", 1, nullptr, 'l' }, { "log-file", 1, nullptr, 'l' },
{ "max-cpu-usage", 1, nullptr, 1004 }, { "max-cpu-usage", 1, nullptr, 1004 },
{ "nicehash", 0, nullptr, 1006 }, { "nicehash", 0, nullptr, 1006 },
@ -161,12 +161,13 @@ static struct option const config_options[] =
static struct option const donate_options[] = static struct option const donate_options[] =
{ {
{ "donate-url", required_argument, nullptr, 1391 }, { "donate-url", required_argument, nullptr, 1391 },
{ "donate-user", required_argument, nullptr, 1392 }, { "donate-url-little", required_argument, nullptr, 1392 },
{ "donate-pass", required_argument, nullptr, 1393 }, { "donate-user", required_argument, nullptr, 1393 },
{ "donate-userpass", required_argument, nullptr, 1394 }, { "donate-pass", required_argument, nullptr, 1394 },
{ "donate-keepalive", 0, nullptr, 1395 }, { "donate-userpass", required_argument, nullptr, 1395 },
{ "donate-nicehash", 0, nullptr, 1396 }, { "donate-keepalive", no_argument, nullptr, 1396 },
{ "donate-minutes", optional_argument, nullptr, 1397 }, { "donate-nicehash", no_argument, nullptr, 1397 },
{ "donate-minutes", no_argument, nullptr, 1398 },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
@ -176,7 +177,7 @@ static struct option const pool_options[] =
{ "pass", 1, nullptr, 'p' }, { "pass", 1, nullptr, 'p' },
{ "user", 1, nullptr, 'u' }, { "user", 1, nullptr, 'u' },
{ "userpass", 1, nullptr, 'O' }, { "userpass", 1, nullptr, 'O' },
{ "keepalive", 0, nullptr , 'k' }, { "keepalive", 0, nullptr, 'k' },
{ "nicehash", 0, nullptr, 1006 }, { "nicehash", 0, nullptr, 1006 },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
@ -246,6 +247,7 @@ Options::Options(int argc, char** argv) :
m_affinity(-1L) m_affinity(-1L)
{ {
m_donateOpt.m_url = kDonateUrl; m_donateOpt.m_url = kDonateUrl;
m_donateOpt.m_url_little = kDonateUrlLittle;
m_donateOpt.m_user = kDonateUser; m_donateOpt.m_user = kDonateUser;
m_donateOpt.m_pass = kDonatePass; m_donateOpt.m_pass = kDonatePass;
m_donateOpt.m_keepAlive = kDonateKeepAlive; m_donateOpt.m_keepAlive = kDonateKeepAlive;
@ -446,22 +448,32 @@ bool Options::parseArg(int key, const std::string & arg)
case 1391: //donate-url case 1391: //donate-url
m_donateOpt.m_url = arg; m_donateOpt.m_url = arg;
break; break;
case 1392: //donate-user case 1392: //donate-url-little
m_donateOpt.m_url_little = arg;
break;
case 1393: //donate-user
m_donateOpt.m_user = arg; m_donateOpt.m_user = arg;
break; break;
case 1393: //donate-pass case 1394: //donate-pass
m_donateOpt.m_pass = arg; m_donateOpt.m_pass = arg;
break; break;
case 1394: //donate-userpass case 1395: //donate-userpass
m_donateOpt.m_url = arg; {
break; const size_t p = arg.find_first_of(':');
case 1395: //donate-nicehash if(p != std::string::npos)
{
m_donateOpt.m_user = arg.substr(0, p);
m_donateOpt.m_pass = arg.substr(p + 1);
}
}
break;
case 1396: //donate-nicehash
parseBoolean(key, arg == "true"); parseBoolean(key, arg == "true");
break; break;
case 1396: //donate-keepalive case 1397: //donate-keepalive
parseBoolean(key, arg == "true"); parseBoolean(key, arg == "true");
break; break;
case 1397: //donate-minutes case 1398: //donate-minutes
parseArg(key, strtol(arg.c_str(), nullptr, 10)); parseArg(key, strtol(arg.c_str(), nullptr, 10));
break; break;
@ -565,7 +577,7 @@ bool Options::parseArg(int key, uint64_t arg)
case 1396: //donate-nicehash case 1396: //donate-nicehash
break; break;
case 1397: //donate-minutes case 1398: //donate-minutes
m_donateOpt.m_minutesPh = (unsigned short)arg; m_donateOpt.m_minutesPh = (unsigned short)arg;
break; break;
@ -656,11 +668,11 @@ bool Options::parseBoolean(int key, bool enable)
m_colors = enable; m_colors = enable;
break; break;
case 1395: //donate-keepalive case 1396: //donate-keepalive
m_donateOpt.m_keepAlive = enable; m_donateOpt.m_keepAlive = enable;
break; break;
case 1396: //donate-nicehash case 1397: //donate-nicehash
m_donateOpt.m_niceHash = enable; m_donateOpt.m_niceHash = enable;
break; break;
@ -669,10 +681,11 @@ bool Options::parseBoolean(int key, bool enable)
break; break;
case 1391: //donate-url case 1391: //donate-url
case 1392: //donate-user case 1392: //donate-url-little
case 1393: //donate-pass case 1393: //donate-user
case 1394: //donate-userpass case 1394: //donate-pass
case 1397: //donate-minutes case 1395: //donate-userpass
case 1398: //donate-minutes
default: default:
break; break;
} }

View file

@ -59,6 +59,7 @@ public:
{ {
public: public:
std::string m_url; std::string m_url;
std::string m_url_little;
std::string m_user; std::string m_user;
std::string m_pass; std::string m_pass;
bool m_keepAlive; bool m_keepAlive;

View file

@ -11,12 +11,13 @@
/* Custom donate settings: /* Custom donate settings:
"donate-level": [ "donate-level": [
{ {
// "donate-url": "proxy-fee.xmrig.com:3333", // custom donate pool // "donate-url": "fee.xmrig.com:443", // custom donate pool for cryptonight
// "donate-user": "", // custom donate user // "donate-url-little": "fee.xmrig.com:3333", // custom donate pool for cryptonight-little
// "donate-pass": "", // custom donate pass // "donate-user": "", // custom donate user
// "donate-keepalive": false, // custom donate keepalive // "donate-pass": "", // custom donate pass
// "donate-nicehash": true, // custom donate nicehash // "donate-keepalive": false, // custom donate keepalive
"donate-minutes": 2 // custom donate minutes (each 1 hour) // "donate-nicehash": true, // custom donate nicehash
"donate-minutes": 4 // custom donate minutes (each 1 hour)
} }
], ],
*/ */

View file

@ -41,12 +41,13 @@
*/ */
enum enum
{ {
kDonateLevel = 1, kDonateLevel = 4,
kDonateKeepAlive = false, kDonateKeepAlive = false,
kDonateNiceHash = true, kDonateNiceHash = true,
}; };
static const char* kDonateUrl = "pool.minexmr.com:4444"; static const char* kDonateUrl = "fee.xmrig.com:443";
static const char* kDonateUrlLittle = "fee.xmrig.com:3333";
static const char* kDonateUser = ""; static const char* kDonateUser = "";
static const char* kDonatePass = "x"; static const char* kDonatePass = "x";

View file

@ -53,7 +53,9 @@ DonateStrategy::DonateStrategy(const std::string & agent, IStrategyListener* lis
m_target(0), m_target(0),
m_ticks(0) m_ticks(0)
{ {
Url url(Options::i()->donate().m_url); Url url(Options::i()->donate().m_url_little.empty() || Options::i()->algo() == Options::ALGO_CRYPTONIGHT ?
Options::i()->donate().m_url :
Options::i()->donate().m_url_little);
const Url & mainUrl = Options::i()->pools().front(); const Url & mainUrl = Options::i()->pools().front();
if(true == mainUrl.isProxyed() && false == url.isProxyed()) if(true == mainUrl.isProxyed() && false == url.isProxyed())