Skip to content
This repository was archived by the owner on Oct 21, 2019. It is now read-only.

Commit d156ee0

Browse files
author
nicehashdev
committed
EthereumStratum/1.0.0 by default and only option
1 parent 8edc811 commit d156ee0

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

ethminer/MinerAux.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class MinerCLI
188188
if (p + 1 <= userpass.length())
189189
m_pass = userpass.substr(p+1);
190190
}
191-
else if ((arg == "-SV" || arg == "--stratum-version") && i + 1 < argc)
191+
/*else if ((arg == "-SV" || arg == "--stratum-version") && i + 1 < argc)
192192
{
193193
try {
194194
m_stratumClientVersion = atoi(argv[++i]);
@@ -200,11 +200,11 @@ class MinerCLI
200200
cerr << "Bad " << arg << " option: " << argv[i] << endl;
201201
BOOST_THROW_EXCEPTION(BadArgument());
202202
}
203-
}
204-
else if (arg == "-ES" || arg == "--ethereum-stratum")
205-
{
206-
m_ethereumStratum = true;
207-
}
203+
}*/
204+
//else if (arg == "-ES" || arg == "--ethereum-stratum")
205+
//{
206+
// m_ethereumStratum = true;
207+
//}
208208
else if ((arg == "-FO" || arg == "--failover-userpass") && i + 1 < argc)
209209
{
210210
string userpass = string(argv[++i]);
@@ -620,8 +620,8 @@ class MinerCLI
620620
<< " -O, --userpass <username.workername:password> Stratum login credentials" << endl
621621
<< " -FO, --failover-userpass <username.workername:password> Failover stratum login credentials (optional, will use normal credentials when omitted)" << endl
622622
<< " --work-timeout <n> reconnect/failover after n seconds of working on the same (stratum) job. Defaults to 180. Don't set lower than max. avg. block time" << endl
623-
<< " -SV, --stratum-version <n> Stratum client version. Defaults to 1 (async client). Use 2 to test new synchronous client." << endl
624-
<< " -ES, --ethereum-stratum Use EthereumStratum/1.0.0 mode." << endl
623+
//<< " -SV, --stratum-version <n> Stratum client version. Defaults to 1 (async client). Use 2 to test new synchronous client." << endl
624+
//<< " -ES, --ethereum-stratum Use EthereumStratum/1.0.0 mode." << endl
625625
#endif
626626
#if ETH_JSONRPC || ETH_STRATUM || !ETH_TRUE
627627
<< " --farm-recheck <n> Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output" << endl
@@ -1092,7 +1092,7 @@ class MinerCLI
10921092

10931093
GenericFarm<EthashProofOfWork> f;
10941094

1095-
EthStratumClientV2 client(&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, m_ethereumStratum);
1095+
EthStratumClientV2 client(&f, m_minerType, m_farmURL, m_port, m_user, m_pass, m_maxFarmRetries, m_worktimeout, true);
10961096
if (m_farmFailOverURL != "")
10971097
{
10981098
if (m_fuser != "")

libstratum/EthStratumClient.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,11 @@ bool EthStratumClient::submit(EthashProofOfWork::Solution solution) {
471471
x_current.unlock();
472472

473473
cnote << "Solution found; Submitting to" << p_active->host << "...";
474-
string minernonce = solution.nonce.hex().substr(m_extraNonceHexSize, 16 - m_extraNonceHexSize);
474+
string minernonce;
475475
if (!m_ethereumStratum)
476476
cnote << " Nonce:" << "0x" + solution.nonce.hex();
477+
else
478+
minernonce = solution.nonce.hex().substr(m_extraNonceHexSize, 16 - m_extraNonceHexSize);
477479

478480
if (EthashAux::eval(tempWork.seedHash, tempWork.headerHash, solution.nonce).value < tempWork.boundary)
479481
{

libstratum/EthStratumClientV2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,11 @@ bool EthStratumClientV2::submit(EthashProofOfWork::Solution solution) {
413413
x_current.unlock();
414414

415415
cnote << "Solution found; Submitting to" << p_active->host << "...";
416-
string minernonce = solution.nonce.hex().substr(m_extraNonceHexSize, 16 - m_extraNonceHexSize);
416+
string minernonce;
417417
if (!m_ethereumStratum)
418418
cnote << " Nonce:" << "0x" + solution.nonce.hex();
419+
else
420+
minernonce = solution.nonce.hex().substr(m_extraNonceHexSize, 16 - m_extraNonceHexSize);
419421

420422
if (EthashAux::eval(tempWork.seedHash, tempWork.headerHash, solution.nonce).value < tempWork.boundary)
421423
{

0 commit comments

Comments
 (0)