From 71870b11c574cc1d5efe11441ac6fa17284f4999 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 20 Sep 2016 13:22:41 +1000 Subject: [PATCH] Remove test that is always true --- src/libckpool.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libckpool.c b/src/libckpool.c index e14ffae4..926cf6ae 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -2047,13 +2047,11 @@ double diff_from_nbits(char *nbits) pow = nbits[0]; powdiff = (8 * (0x1d - 3)) - (8 * (pow - 3)); - if (powdiff < 8) + if (powdiff < 8) // testnet only powdiff = 8; diff32 = be32toh(*((uint32_t *)nbits)) & 0x00FFFFFF; - if (likely(powdiff > 0)) - numerator = 0xFFFFULL << powdiff; - else - numerator = 0xFFFFULL >> -powdiff; + numerator = 0xFFFFULL << powdiff; + return numerator / (double)diff32; }