Commit 388e0877b502ef7f2d65dcf2055e6f912f4068f5

Con Kolivas 2014-03-16T22:49:25

Store strings similar to stratum's when decoding gbt solo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index 174c40a..3336df8 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2248,12 +2248,16 @@ static bool gbt_solo_decode(struct pool *pool, json_t *res_val)
 	cg_wlock(&pool->gbt_lock);
 	hex2bin(hash_swap, previousblockhash, 32);
 	swap256(pool->previousblockhash, hash_swap);
+	__bin2hex(pool->prev_hash, pool->previousblockhash, 32);
 
 	hex2bin(hash_swap, target, 32);
 	swab256(pool->gbt_target, hash_swap);
 
 	pool->gbt_version = htobe32(version);
 	pool->curtime = htobe32(curtime);
+	snprintf(pool->ntime, 9, "%08x", curtime);
+	snprintf(pool->bbversion, 9, "%08x", version);
+	snprintf(pool->nbit, 9, "%s", bits);
 	pool->nValue = coinbasevalue;
 	hex2bin((unsigned char *)&pool->gbt_bits, bits, 4);
 	gbt_merkle_bins(pool, transaction_arr);