From 9db532e1cbdddaac592b35d88902d33c48198e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Krzemi=C5=84ski-Freda?= Date: Sun, 27 Mar 2016 22:43:49 +0200 Subject: [PATCH] Report correct difficulty The same bug was reported to MUE team in the october last year. Currently its impossible to properly calculate mining rewards against the difficulty, as the results are multiplied by 256. I think that the bug comes from forking the code from Dash. Link to commit that fixed it for MUE: https://github.com/MonetaryUnit/MUE-Src/commit/23639453cf443455e200864d77af60f3ceb5d280 --- src/rpcblockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 8493b42a4ae6..b21a99499ea4 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -38,12 +38,12 @@ double GetDifficulty(const CBlockIndex* blockindex) double dDiff = (double)0x0000ffff / (double)(blockindex->nBits & 0x00ffffff); - while (nShift < 29) + while (nShift < 30) { dDiff *= 256.0; nShift++; } - while (nShift > 29) + while (nShift > 30) { dDiff /= 256.0; nShift--;