From 47938c38b29798c8683fc7496aa3c8eb9018c50e Mon Sep 17 00:00:00 2001 From: elbandi Date: Sun, 23 Apr 2017 16:03:58 +0000 Subject: [PATCH] Handle decred new stake version field --- sgminer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sgminer.c b/sgminer.c index 79503abe..8a79d8bf 100644 --- a/sgminer.c +++ b/sgminer.c @@ -6195,6 +6195,8 @@ static void gen_stratum_work(struct pool *pool, struct work *work) ((uint32_t *)work->data)[i] = 0; memcpy(work->data + 144, pool->nonce1bin, nonce2_offset); memcpy(work->data + 144 + nonce2_offset, &nonce2le, pool->n2size); + size_t extranonce_len = MAX((int)pool->swork.cb_len - pool->nonce2_offset - pool->n2size, 0); + memcpy(work->data + 180 - extranonce_len, pool->coinbase + pool->nonce2_offset + pool->n2size, extranonce_len); } else if (pool->algorithm.type == ALGO_SIA) { size_t nonce2_offset = MIN(pool->n1_len, 4);