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:
parent
6cebabea9a
commit
f22fe76157
10
cgminer.c
10
cgminer.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user