[rpc] Fixup for network difficulty merge

This commit is contained in:
Jon Layton 2018-10-23 11:44:22 -05:00
parent 52b7943105
commit 7227a8180a
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);