diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 71f5469dd..53ff29626 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -209,7 +209,7 @@ u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const u256 o = max(c_minimumDifficulty, m_timestamp >= _parent.m_timestamp + c_durationLimit ? _parent.m_difficulty - (_parent.m_difficulty / c_difficultyBoundDivisor) : (_parent.m_difficulty + (_parent.m_difficulty / c_difficultyBoundDivisor))); unsigned periodCount = unsigned(_parent.number() + 1) / c_expDiffPeriod; if (periodCount > 2) - o = (u256)max(c_minimumDifficulty, bigint(o) - (bigint(1) << (periodCount - 2))); // latter will eventually become negative, so ensure it's a bigint. + o = max(c_minimumDifficulty, o + (u256(1) << (periodCount - 2))); // latter will eventually become huge, so ensure it's a bigint. return o; }