diff --git a/cgminer.c b/cgminer.c index 09fd0085..c12d65e4 100644 --- a/cgminer.c +++ b/cgminer.c @@ -4095,7 +4095,7 @@ static void set_blockdiff(const struct work *work) { uint8_t pow = work->data[72]; int powdiff = (8 * (0x1d - 3)) - (8 * (pow - 3)); - uint32_t diff32 = swab32(*((uint32_t *)(work->data + 72))) & 0x00FFFFFF; + uint32_t diff32 = be32toh(*((uint32_t *)(work->data + 72))) & 0x00FFFFFF; double numerator = 0xFFFFULL << powdiff; double ddiff = numerator / (double)diff32;