aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-02-24 12:48:45 +0100
committerWladimir J. van der Laan <[email protected]>2017-02-24 12:48:56 +0100
commitf19afdbfb4cb2223d492d5e7d4087567af9d5f28 (patch)
treea2665c989ee148efda01131fa2b68322a61b94eb /src
parentMerge #9833: Trivial: fix comments referencing AppInit2 (diff)
parentTrivial: Rephrase the definition of difficulty in the code. (diff)
downloaddiscoin-f19afdbfb4cb2223d492d5e7d4087567af9d5f28.tar.xz
discoin-f19afdbfb4cb2223d492d5e7d4087567af9d5f28.zip
Merge #9612: [trivial] Rephrase the definition of difficulty.
dc222f8 Trivial: Rephrase the definition of difficulty in the code. (Karl-Johan Alm)
Diffstat (limited to 'src')
-rw-r--r--src/rpc/blockchain.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 7b69c81ff..6826ce4a7 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -43,10 +43,15 @@ static CUpdatedBlock latestblock;
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)