From cc296a061861ed3138a533bef550f56fe3ad7872 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 12 Sep 2014 17:42:52 +0200 Subject: [PATCH] stratum: check if job was read --- cpu-miner.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu-miner.c b/cpu-miner.c index c42997a..7ada599 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -789,6 +789,11 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work) unsigned char merkle_root[64]; int i; + if (!sctx->job.job_id) { + /* job not yet retrieved */ + return; + } + pthread_mutex_lock(&sctx->work_lock); // store the job ntime as high part of jobid