From 8c474c1784ba9686790033034e1c87c0dbdd90d9 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 14 Dec 2015 17:34:48 +1100 Subject: [PATCH] Support low diffs like those on testnet --- src/libckpool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libckpool.c b/src/libckpool.c index 4c315dfb..8e08253a 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -1982,6 +1982,8 @@ double diff_from_nbits(char *nbits) pow = nbits[0]; powdiff = (8 * (0x1d - 3)) - (8 * (pow - 3)); + if (powdiff < 8) + powdiff = 8; diff32 = be32toh(*((uint32_t *)nbits)) & 0x00FFFFFF; numerator = 0xFFFFULL << powdiff; return numerator / (double)diff32;