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

Share_diff should not be converting the work data to hex.

This commit is contained in:
Con Kolivas 2012-10-12 17:36:48 +11:00
parent 6cebabea9a
commit f22fe76157

View File

@ -1974,16 +1974,12 @@ share_result(json_t *val, json_t *res, json_t *err, const struct work *work,
static uint64_t share_diff(const struct work *work)
{
const uint64_t h64 = 0xFFFF000000000000ull;
char rtarget[33], *target;
uint64_t *data64, d64;
char rhash[33];
uint64_t ret;
target = bin2hex(work->hash, 32);
if (unlikely(!target))
quit(1, "Failed to bin2hex in share_diff");
swab256(rtarget, target);
free(target);
data64 = (uint64_t *)(rtarget + 4);
swab256(rhash, work->hash);
data64 = (uint64_t *)(rhash + 4);
d64 = be64toh(*data64);
if (unlikely(!d64))
d64 = 1;