Improve comments per review

This commit is contained in:
Jack Grigg
2016-06-16 10:45:19 +12:00
parent 284e125957
commit 5e207f4ea5
3 changed files with 14 additions and 13 deletions

View File

@@ -45,16 +45,13 @@ Value GetNetworkHashPS(int lookup, int height) {
if (pb == NULL || !pb->nHeight)
return 0;
// If lookup is -1, then use difficulty averaging window.
// If lookup is nonpositive, then use difficulty averaging window.
if (lookup <= 0)
lookup = pb->nHeight - Params().GetConsensus().nPowAveragingWindow;
// If lookup is still negative, then use blocks since genesis.
if (lookup <= 0)
lookup = pb->nHeight;
// If lookup is larger than chain, then set it to chain length.
if (lookup > pb->nHeight)
// If lookup is still nonpositive, or is larger than chain, then set it to
// chain length.
if (lookup <= 0 || lookup > pb->nHeight)
lookup = pb->nHeight;
CBlockIndex *pb0 = pb;