Fix bug in network hashrate lookup window configuration
This commit is contained in:
parent
1178df0883
commit
cdec0b923e
|
@ -47,11 +47,10 @@ Value GetNetworkHashPS(int lookup, int height) {
|
||||||
|
|
||||||
// If lookup is nonpositive, then use difficulty averaging window.
|
// If lookup is nonpositive, then use difficulty averaging window.
|
||||||
if (lookup <= 0)
|
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
|
// If lookup is larger than chain, then set it to chain length.
|
||||||
// chain length.
|
if (lookup > pb->nHeight)
|
||||||
if (lookup <= 0 || lookup > pb->nHeight)
|
|
||||||
lookup = pb->nHeight;
|
lookup = pb->nHeight;
|
||||||
|
|
||||||
CBlockIndex *pb0 = pb;
|
CBlockIndex *pb0 = pb;
|
||||||
|
|
Loading…
Reference in New Issue