Make submit_nonce2_nonce return whether the share was valid or not
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/cgminer.c b/cgminer.c
index 3739118..53577f3 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6849,13 +6849,14 @@ void set_target(unsigned char *dest_target, double diff)
}
#if defined (USE_AVALON2) || defined (USE_HASHRATIO)
-void submit_nonce2_nonce(struct thr_info *thr, struct pool *pool, struct pool *real_pool,
+bool submit_nonce2_nonce(struct thr_info *thr, struct pool *pool, struct pool *real_pool,
uint32_t nonce2, uint32_t nonce)
{
const int thr_id = thr->id;
struct cgpu_info *cgpu = thr->cgpu;
struct device_drv *drv = cgpu->drv;
struct work *work = make_work();
+ bool ret;
cg_wlock(&pool->data_lock);
pool->nonce2 = nonce2;
@@ -6869,10 +6870,11 @@ void submit_nonce2_nonce(struct thr_info *thr, struct pool *pool, struct pool *r
work->pool->works++;
work->mined = true;
- work->device_diff = MIN(cgpu->drv->max_diff, work->work_difficulty);
+ work->device_diff = MIN(drv->max_diff, work->work_difficulty);
- submit_nonce(thr, work, nonce);
+ ret = submit_nonce(thr, work, nonce);
free_work(work);
+ return ret;
}
#endif
diff --git a/miner.h b/miner.h
index f8db614..94e44f0 100644
--- a/miner.h
+++ b/miner.h
@@ -1094,7 +1094,7 @@ extern void clear_stratum_shares(struct pool *pool);
extern void clear_pool_work(struct pool *pool);
extern void set_target(unsigned char *dest_target, double diff);
#if defined (USE_AVALON2) || defined (USE_HASHRATIO)
-void submit_nonce2_nonce(struct thr_info *thr, struct pool *pool, struct pool *real_pool,
+bool submit_nonce2_nonce(struct thr_info *thr, struct pool *pool, struct pool *real_pool,
uint32_t nonce2, uint32_t nonce);
#endif
extern int restart_wait(struct thr_info *thr, unsigned int mstime);