Skip to content

Commit e5ece05

Browse files
committed
Rename Interval() to DifficultyAdjustmentInterval()
1 parent 175d86e commit e5ece05

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/chainparams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CChainParams
6868
bool RequireStandard() const { return fRequireStandard; }
6969
int64_t TargetTimespan() const { return nTargetTimespan; }
7070
int64_t TargetSpacing() const { return nTargetSpacing; }
71-
int64_t Interval() const { return nTargetTimespan / nTargetSpacing; }
71+
int64_t DifficultyAdjustmentInterval() const { return nTargetTimespan / nTargetSpacing; }
7272
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */
7373
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
7474
/** In the future use NetworkIDString() for RPC fields */

src/pow.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
2020
if (pindexLast == NULL)
2121
return nProofOfWorkLimit;
2222

23-
// Only change once per interval
24-
if ((pindexLast->nHeight+1) % Params().Interval() != 0)
23+
// Only change once per difficulty adjustment interval
24+
if ((pindexLast->nHeight+1) % Params().DifficultyAdjustmentInterval() != 0)
2525
{
2626
if (Params().AllowMinDifficultyBlocks())
2727
{
@@ -34,7 +34,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
3434
{
3535
// Return the last non-special-min-difficulty-rules-block
3636
const CBlockIndex* pindex = pindexLast;
37-
while (pindex->pprev && pindex->nHeight % Params().Interval() != 0 && pindex->nBits == nProofOfWorkLimit)
37+
while (pindex->pprev && pindex->nHeight % Params().DifficultyAdjustmentInterval() != 0 && pindex->nBits == nProofOfWorkLimit)
3838
pindex = pindex->pprev;
3939
return pindex->nBits;
4040
}
@@ -44,7 +44,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
4444

4545
// Go back by what we want to be 14 days worth of blocks
4646
const CBlockIndex* pindexFirst = pindexLast;
47-
for (int i = 0; pindexFirst && i < Params().Interval()-1; i++)
47+
for (int i = 0; pindexFirst && i < Params().DifficultyAdjustmentInterval()-1; i++)
4848
pindexFirst = pindexFirst->pprev;
4949
assert(pindexFirst);
5050

src/rpcmining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Value GetNetworkHashPS(int lookup, int height) {
4444

4545
// If lookup is -1, then use blocks since last difficulty change.
4646
if (lookup <= 0)
47-
lookup = pb->nHeight % Params().Interval() + 1;
47+
lookup = pb->nHeight % Params().DifficultyAdjustmentInterval() + 1;
4848

4949
// If lookup is larger than chain, then set it to chain length.
5050
if (lookup > pb->nHeight)

0 commit comments

Comments
 (0)