Browse Source

Fix bug in network hashrate lookup window configuration

pull/145/head
Jack Grigg 8 years ago
parent
commit
cdec0b923e
  1. 7
      src/rpcmining.cpp

7
src/rpcmining.cpp

@ -47,11 +47,10 @@ Value GetNetworkHashPS(int lookup, int height) {
// If lookup is nonpositive, then use difficulty averaging window.
if (lookup <= 0)
lookup = pb->nHeight - Params().GetConsensus().nPowAveragingWindow;
lookup = Params().GetConsensus().nPowAveragingWindow;
// If lookup is still nonpositive, or is larger than chain, then set it to
// chain length.
if (lookup <= 0 || lookup > pb->nHeight)
// If lookup is larger than chain, then set it to chain length.
if (lookup > pb->nHeight)
lookup = pb->nHeight;
CBlockIndex *pb0 = pb;

Loading…
Cancel
Save