Merge pull request #439 from rnicoll/1.7-dev-network-hashps
Update difficulty change interval constant to match 1.6
This commit is contained in:
commit
c4691d0b39
|
@ -21,6 +21,9 @@
|
|||
using namespace json_spirit;
|
||||
using namespace std;
|
||||
|
||||
// Number of blocks between difficulty changes
|
||||
static const int kDifficultyChangeInterval = 240;
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
// Key used by getwork miners.
|
||||
// Allocated in InitRPCMining, free'd in ShutdownRPCMining
|
||||
|
@ -65,7 +68,7 @@ Value GetNetworkHashPS(int lookup, int height) {
|
|||
|
||||
// If lookup is -1, then use blocks since last difficulty change.
|
||||
if (lookup <= 0)
|
||||
lookup = pb->nHeight % 2016 + 1;
|
||||
lookup = pb->nHeight % kDifficultyChangeInterval + 1;
|
||||
|
||||
// If lookup is larger than chain, then set it to chain length.
|
||||
if (lookup > pb->nHeight)
|
||||
|
|
Loading…
Reference in a new issue