diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index 46d0dd54ad426..8251c873afef6 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -21,24 +21,24 @@ uint256 CBlockHeader::GetPoWHash() const uint256 thash; unsigned char Nfactor; const unsigned char minNfactor = 10; - const unsigned char maxNfactor = 20; + const unsigned char maxNfactor = 20; - // epoch times of chain start and current block time - int64_t nChainStartTime = 1515925970; + // epoch times of chain start and current block time + int64_t nChainStartTime = 1515925970; - // n-factor will change every this interval is hit - int64_t nChangeInterval = 36288000; //200 days + // n-factor will change every this interval is hit + int64_t nChangeInterval = 36288000; // 420 days if (GetBlockTime() <= nChainStartTime) { - Nfactor = minNfactor; - } else { - int64_t s = GetBlockTime() - nChainStartTime; - int n = s/nChangeInterval + 10; - - if (n < 0) n = 0; - unsigned char tempN = (unsigned char) n; - Nfactor = std::min(std::max(tempN, minNfactor), maxNfactor); - } + Nfactor = minNfactor; + } else { + int64_t s = GetBlockTime() - nChainStartTime; + int n = s/nChangeInterval + 10; + + if (n < 0) n = 0; + unsigned char tempN = (unsigned char) n; + Nfactor = std::min(std::max(tempN, minNfactor), maxNfactor); + } scrypt_N_1_1_256(BEGIN(nVersion), BEGIN(thash), Nfactor); return thash; }