From 721d6d22ab62fc4314947713ec1588eb5a07c527 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 17 Nov 2014 13:57:40 +1100 Subject: [PATCH] Set the initial enonce1 to a value that will differ on every restart --- src/stratifier.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index f20db9d8..c25f1e50 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3670,6 +3670,7 @@ int stratifier(proc_instance_t *pi) pthread_t pth_blockupdate, pth_statsupdate, pth_heartbeat; ckpool_t *ckp = pi->ckp; int ret = 1, threads; + int64_t randomiser; sdata_t *sdata; char *buf; @@ -3702,10 +3703,12 @@ int stratifier(proc_instance_t *pi) } } + randomiser = ((int64_t)time(NULL)) << 32; /* Set the initial id to time as high bits so as to not send the same * id on restarts */ if (!ckp->proxy) - sdata->blockchange_id = sdata->workbase_id = ((int64_t)time(NULL)) << 32; + sdata->blockchange_id = sdata->workbase_id = randomiser; + sdata->enonce1u.u64 = htobe64(randomiser); dealloc(buf);