Solve proof of works if requested.

This commit is contained in:
JoelKatz
2012-12-05 23:48:23 -08:00
parent 7f313afe80
commit e0a9520d9d
3 changed files with 55 additions and 2 deletions

View File

@@ -33,13 +33,15 @@ protected:
static const int sMaxIterations;
public:
typedef boost::shared_ptr<ProofOfWork> pointer;
ProofOfWork(const std::string& token, int iterations, const uint256& challenge, const uint256& target) :
mToken(token), mChallenge(challenge), mTarget(target), mIterations(iterations)
{ ; }
bool isValid() const;
uint256 solve(int maxIterations) const;
uint256 solve(int maxIterations = 2 * sMaxIterations) const;
bool checkSolution(const uint256& solution) const;
const std::string& getToken() const { return mToken; }