From bfac6969251b546d37db42ef44b180be636625f8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 16 Nov 2012 02:43:06 +0000 Subject: [PATCH] Bugfix: Properly process new stratum jobs through test_work_current, even if old shares are still accepted, and copy submit_old flag correctly --- miner.c | 1 + util.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/miner.c b/miner.c index c42bb75984..4278db7c51 100644 --- a/miner.c +++ b/miner.c @@ -5217,6 +5217,7 @@ static void *stratum_thread(void *userdata) * block database */ pool->swork.clean = false; gen_stratum_work(pool, &work); + ++pool->work_restart_id; if (test_work_current(&work)) { /* Only accept a work restart if this stratum * connection is from the current pool */ diff --git a/util.c b/util.c index 874651176b..c2b9195e89 100644 --- a/util.c +++ b/util.c @@ -1080,7 +1080,8 @@ static bool parse_notify(struct pool *pool, json_t *val) pool->swork.bbversion = bbversion; pool->swork.nbit = nbit; pool->swork.ntime = ntime; - pool->swork.clean = clean; + pool->submit_old = !clean; + pool->swork.clean = true; for (i = 0; i < pool->swork.merkles; i++) free(pool->swork.merkle[i]); if (merkles) {