diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 67a0fb07b..01f205ce3 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -21,6 +21,8 @@ using namespace json_spirit; using namespace std; +static const int kLookupSpanMod = 240; + #ifdef ENABLE_WALLET // Key used by getwork miners. // Allocated in InitRPCMining, free'd in ShutdownRPCMining @@ -65,7 +67,7 @@ Value GetNetworkHashPS(int lookup, int height) { // If lookup is -1, then use blocks since last difficulty change. if (lookup <= 0) - lookup = pb->nHeight % 2016 + 1; + lookup = pb->nHeight % kLookupSpanMod + 1; // If lookup is larger than chain, then set it to chain length. if (lookup > pb->nHeight)