Merge pull request #98 from ch4ot1c/fixup/network-difficulty-merge

[rpc] Fixup for network difficulty merge
This commit is contained in:
Jon Layton 2018-10-23 12:15:35 -05:00 committed by GitHub
commit 321d5075fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#include <policy/feerate.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <pow.h>
#include <primitives/transaction.h>
#include <rpc/server.h>
#include <script/descriptor.h>
@ -71,7 +72,7 @@ double GetDifficultyINTERNAL(const CBlockIndex* blockindex, bool networkDifficul
uint32_t bits;
if (networkDifficulty) {
bits = GetNextWorkRequired(blockindex, nullptr, Params().GetConsensus());
bits = GetNextWorkRequired(blockindex, nullptr, Params());
} else {
bits = blockindex->nBits;
}
@ -104,7 +105,7 @@ double GetDifficultyINTERNAL(const CBlockIndex* blockindex, bool networkDifficul
double GetDifficulty(const CBlockIndex* blockindex)
{
return GetDifficulty(chainActive, blockindex);
return GetDifficultyINTERNAL(blockindex, false);
}
double GetNetworkDifficulty(const CBlockIndex* blockindex)

View File

@ -21,7 +21,7 @@ static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
* @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 = nullptr);
double GetNetworkDifficulty(const CBlockIndex* blockindex = nullptr);