changeset 26721:a8520fefcedf

Merge #9612: [trivial] Rephrase the definition of difficulty. dc222f8 Trivial: Rephrase the definition of difficulty in the code. (Karl-Johan Alm)
author Wladimir J. van der Laan <laanwj@gmail.com>
date Fri, 24 Feb 2017 12:48:45 +0100
parents ac1f0f9aff5d fee217f23f5b
children dc409b41e670 1a7b1b9d148b d4d3e8574c13 125b0105f811
files
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/rpc/blockchain.cpp	Fri Feb 24 10:53:24 2017 +0100
+++ b/src/rpc/blockchain.cpp	Fri Feb 24 12:48:45 2017 +0100
@@ -43,10 +43,15 @@
 extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
 void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
 
+/**
+ * Get the difficulty of the net wrt to the given block index, or the chain tip if
+ * not provided.
+ *
+ * @return A floating point number that is a multiple of the main net minimum
+ * difficulty (4295032833 hashes).
+ */
 double GetDifficulty(const CBlockIndex* blockindex)
 {
-    // Floating point number that is a multiple of the minimum difficulty,
-    // minimum difficulty = 1.0.
     if (blockindex == NULL)
     {
         if (chainActive.Tip() == NULL)