aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2017-01-23 10:12:02 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2017-02-23 22:06:37 -0800
commitdc222f8f634d5bb82d4646f9a17f0d40a60bcf60 (patch)
tree6c448f6db4bb1839130892c853fc4f991c81622e /src/rpc
parent692c9eddba67d5a7ceb85fa4b2632f664c68f418 (diff)
downloadbitcoin-dc222f8f634d5bb82d4646f9a17f0d40a60bcf60.tar.xz
Trivial: Rephrase the definition of difficulty in the code.
Diffstat (limited to 'src/rpc')
-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 7b69c81ff9..6826ce4a79 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)