From 564ed4faee302827f1ff6e72f3b91ff5dbe57e4c Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 15 Mar 2014 12:54:08 +0000 Subject: [PATCH] Clarified label on constant containing difficulty change interval. --- src/rpcmining.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index cc78db76e..2d6b84d55 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -12,7 +12,8 @@ using namespace json_spirit; using namespace std; -static const int kLookupSpanMod = 240; +// Number of blocks between difficulty changes +static const int kDifficultyChangeInterval = 240; // Return average network hashes per second based on the last 'lookup' blocks, // or from the last difficulty change if 'lookup' is nonpositive. @@ -28,7 +29,7 @@ Value GetNetworkHashPS(int lookup, int height) { // If lookup is -1, then use blocks since last difficulty change. if (lookup <= 0) - lookup = pb->nHeight % kLookupSpanMod + 1; + lookup = pb->nHeight % kDifficultyChangeInterval + 1; // If lookup is larger than chain, then set it to chain length. if (lookup > pb->nHeight)