1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Combine shared padding into one char.

This commit is contained in:
Con Kolivas 2012-12-04 21:29:49 +11:00
parent e14d1d6e2a
commit 52b4bae961

View File

@ -1550,6 +1550,8 @@ static void update_gbt(struct pool *pool)
curl_easy_cleanup(curl);
}
static char *workpadding = "000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000";
static void gen_gbt_work(struct pool *pool, struct work *work)
{
unsigned char *merkleroot;
@ -1584,7 +1586,7 @@ static void gen_gbt_work(struct pool *pool, struct work *work)
free(merkleroot);
memset(work->data + 4 + 32 + 32 + 4 + 4, 0, 4); /* nonce */
hex2bin(work->data + 4 + 32 + 32 + 4 + 4 + 4, "000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000", 48);
hex2bin(work->data + 4 + 32 + 32 + 4 + 4 + 4, workpadding, 48);
if (opt_debug) {
char *header = bin2hex(work->data, 128);
@ -5318,7 +5320,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
header = realloc_strcat(header, pool->swork.ntime);
header = realloc_strcat(header, pool->swork.nbit);
header = realloc_strcat(header, "00000000"); /* nonce */
header = realloc_strcat(header, "000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000");
header = realloc_strcat(header, workpadding);
/* Store the stratum work diff to check it still matches the pool's
* stratum diff when submitting shares */