Merge #9612: [trivial] Rephrase the definition of difficulty.
dc222f8
Trivial: Rephrase the definition of difficulty in the code. (Karl-Johan Alm)
This commit is contained in:
commit
f19afdbfb4
1 changed files with 7 additions and 2 deletions
|
@ -43,10 +43,15 @@ static CUpdatedBlock latestblock;
|
||||||
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
|
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
|
||||||
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
|
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)
|
double GetDifficulty(const CBlockIndex* blockindex)
|
||||||
{
|
{
|
||||||
// Floating point number that is a multiple of the minimum difficulty,
|
|
||||||
// minimum difficulty = 1.0.
|
|
||||||
if (blockindex == NULL)
|
if (blockindex == NULL)
|
||||||
{
|
{
|
||||||
if (chainActive.Tip() == NULL)
|
if (chainActive.Tip() == NULL)
|
||||||
|
|
Loading…
Reference in a new issue