aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
authorAlan Westbrook <[email protected]>2014-01-29 00:17:29 -0800
committerAlan Westbrook <[email protected]>2014-01-29 00:17:34 -0800
commit665efc9ecc82217bfa2f07e645ee8022f5e45387 (patch)
tree1008574a5330c0da2cb29368bc5fb98bba333882 /src/rpcmining.cpp
parentUpdate dogecoin.conf (diff)
downloaddiscoin-665efc9ecc82217bfa2f07e645ee8022f5e45387.tar.xz
discoin-665efc9ecc82217bfa2f07e645ee8022f5e45387.zip
Change the lookup span modulo constant to something smaller
Why? Not really sure, but whatever.
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 4cf5e58fc..cc78db76e 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -12,6 +12,8 @@
using namespace json_spirit;
using namespace std;
+static const int kLookupSpanMod = 240;
+
// Return average network hashes per second based on the last 'lookup' blocks,
// or from the last difficulty change if 'lookup' is nonpositive.
// If 'height' is nonnegative, compute the estimate at the time when a given block was found.
@@ -26,7 +28,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)