diff options
| author | Gregory Maxwell <[email protected]> | 2013-12-29 03:14:06 -0800 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2013-12-29 03:14:06 -0800 |
| commit | aec55a073def2e6d5d11ae0e8ca5efb48c9cb0fe (patch) | |
| tree | 8472dcf98b2aca2517008382c27bd9575a98b1ae /src/rpcmining.cpp | |
| parent | Merge pull request #3453 (diff) | |
| download | discoin-aec55a073def2e6d5d11ae0e8ca5efb48c9cb0fe.tar.xz discoin-aec55a073def2e6d5d11ae0e8ca5efb48c9cb0fe.zip | |
"getnetworkhashps" with defaults was yielding "0", the hashrate is not 0.
This was broken in 4c6d41b8b653ef90639b1a32f6aab0bb1cef90c5.
Diffstat (limited to 'src/rpcmining.cpp')
| -rw-r--r-- | src/rpcmining.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 1a8462fde..564f0401f 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -55,7 +55,10 @@ void ShutdownRPCMining() // 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. Value GetNetworkHashPS(int lookup, int height) { - CBlockIndex *pb = chainActive[height]; + CBlockIndex *pb = chainActive.Tip(); + + if (height >= 0 && height < chainActive.Height()) + pb = chainActive[height]; if (pb == NULL || !pb->nHeight) return 0; |