We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e77920 commit aec55a0Copy full SHA for aec55a0
src/rpcmining.cpp
@@ -55,7 +55,10 @@ void ShutdownRPCMining()
55
// or from the last difficulty change if 'lookup' is nonpositive.
56
// If 'height' is nonnegative, compute the estimate at the time when a given block was found.
57
Value GetNetworkHashPS(int lookup, int height) {
58
- CBlockIndex *pb = chainActive[height];
+ CBlockIndex *pb = chainActive.Tip();
59
+
60
+ if (height >= 0 && height < chainActive.Height())
61
+ pb = chainActive[height];
62
63
if (pb == NULL || !pb->nHeight)
64
return 0;
0 commit comments