Skip to content

Commit

Permalink
Remove Miner::submitProof() wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jul 20, 2017
1 parent 90d91de commit 8650f6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion libethash-cl/CLMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void CLMiner::report(uint64_t _nonce)
// TODO: Why re-evaluating?
Result r = EthashAux::eval(w.seed, w.header, _nonce);
if (r.value < w.boundary)
submitProof(Solution{_nonce, r.mixHash, w.header, w.seed, w.boundary});
farm().submitProof(Solution{_nonce, r.mixHash, w.header, w.seed, w.boundary});
else
cwarn << "Invalid solution";
}
Expand Down
2 changes: 1 addition & 1 deletion libethcore/EthashCUDAMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void EthashCUDAMiner::report(uint64_t _nonce)
WorkPackage w = work(); // Copy work package to avoid repeated mutex lock.
Result r = EthashAux::eval(w.seed, w.header, _nonce);
if (r.value < w.boundary)
submitProof(Solution{_nonce, r.mixHash, w.header, w.seed, w.boundary});
farm().submitProof(Solution{_nonce, r.mixHash, w.header, w.seed, w.boundary});
}

void EthashCUDAMiner::kickOff()
Expand Down
14 changes: 1 addition & 13 deletions libethcore/Miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ class Miner: public Worker

protected:


// REQUIRED TO BE REIMPLEMENTED BY A SUBCLASS:

/**
* @brief Begin working on a given work package, discarding any previous work.
* @param _work The package for which to find a solution.
Expand All @@ -187,16 +184,7 @@ class Miner: public Worker
*/
virtual void pause() = 0;

// AVAILABLE FOR A SUBCLASS TO CALL:

/**
* @brief Notes that the Miner found a solution.
* @param _s The solution.
*/
void submitProof(Solution const& _s)
{
m_farm.submitProof(_s);
}
FarmFace& farm() { return m_farm; }

WorkPackage const& work() const { Guard l(x_work); return m_work; }

Expand Down

0 comments on commit 8650f6d

Please sign in to comment.