Skip to content

Commit f18cca8

Browse files
use challenges received from pool, even if it is an old challenge
1 parent 4d95f8d commit f18cca8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ethminer/MinerAux.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,21 +820,20 @@ class MinerCLI
820820
if (_challenge != challenge)
821821
{
822822
// when queried for the most recent challenge, infura nodes will occasionally respond with the
823-
// previous one. this only applies to solo mining, but doesn't hurt to do it for pool mining.
823+
// previous one. this only applies to solo mining. when pool mining, always use what the pool gives us.
824824
bool seenBefore = false;
825825
for (bytes c : recentChallenges)
826826
seenBefore = (seenBefore || (c == _challenge));
827-
if (!seenBefore)
827+
if (!seenBefore || m_opMode == OperationMode::Pool)
828828
{
829829
recentChallenges.push_front(_challenge);
830830
if (recentChallenges.size() > 5)
831831
recentChallenges.pop_back();
832832
challenge = _challenge;
833833
target = _target;
834-
LogS << "New challenge : " << toHex(_challenge).substr(0, 8);
834+
LogB << "New challenge : " << toHex(_challenge).substr(0, 8);
835835
f.setWork_token(challenge, target);
836836
workRPC.setChallenge(challenge);
837-
838837
}
839838
}
840839
if (_target != target)

0 commit comments

Comments
 (0)