Skip to content

Commit

Permalink
Fix job decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjones committed May 23, 2014
1 parent 9bebbb3 commit 6bc483a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ bool rpc2_job_decode(const json_t *job, struct work *work) {
hashrate += thr_hashrates[i];
pthread_mutex_unlock(&stats_lock);
double difficulty = (((double) 0xffffffff) / target);
applog(LOG_INFO, "[JSON-RPC] diff set to %g", difficulty);
applog(LOG_INFO, "Pool set diff to %g", difficulty);
rpc2_target = target;
}

Expand Down
9 changes: 1 addition & 8 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,16 +993,9 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
static bool stratum_2_job(struct stratum_ctx *sctx, json_t *params)
{
bool ret = false;

json_t *job = json_object_get(params, "job");
if(!job) goto out;

pthread_mutex_lock(&sctx->work_lock);
ret = rpc2_job_decode(job, &sctx->work);
ret = rpc2_job_decode(params, &sctx->work);
pthread_mutex_unlock(&sctx->work_lock);

out:

return ret;
}

Expand Down

0 comments on commit 6bc483a

Please sign in to comment.