diff --git a/src/main.cpp b/src/main.cpp index 80dcf5d2..481e0f0a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1732,8 +1732,8 @@ void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev) block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); // Updating time can change work required on testnet: - if (TestNet()) - block.nBits = GetNextWorkRequired(pindexPrev, &block, block.GetAlgo()); + //if (TestNet()) + // block.nBits = GetNextWorkRequired(pindexPrev, &block, block.GetAlgo()); } @@ -2668,6 +2668,8 @@ bool CheckBlock(const CBlock& block, CValidationState& state, int nHeight, bool bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) { + LogPrintf("AcceptBlock: BlockTime=%d\n", block.nTime); + AssertLockHeld(cs_main); // Check for duplicate uint256 hash = block.GetHash(); diff --git a/src/main.h b/src/main.h index d38c7ea2..4e296e50 100644 --- a/src/main.h +++ b/src/main.h @@ -964,7 +964,7 @@ public: CBigNum GetBlockWorkAdjusted() const { CBigNum bnRes; - if ((TestNet() && (nHeight > 500)) || + if ((TestNet() && (nHeight > 50)) || (nHeight >= GeoAvgWork_Start)) { CBigNum nBlockWork = GetBlockWork(); @@ -978,6 +978,7 @@ public: nBlockWork *= nBlockWorkAlt; } } + bnRes = nBlockWork; // Compute the geometric mean bnRes = bnRes.nthRoot(NUM_ALGOS); // Scale to roughly match the old work calculation