10 #include <boost/test/unit_test.hpp>
18 int64_t nLastRetargetTime = 1261130161;
21 pindexLast.
nTime = 1262152739;
22 pindexLast.
nBits = 0x1d00ffff;
30 int64_t nLastRetargetTime = 1231006505;
33 pindexLast.
nTime = 1233061996;
34 pindexLast.
nBits = 0x1d00ffff;
42 int64_t nLastRetargetTime = 1279008237;
45 pindexLast.
nTime = 1279297671;
46 pindexLast.
nBits = 0x1c05a3f4;
54 int64_t nLastRetargetTime = 1263163443;
57 pindexLast.
nTime = 1269211443;
58 pindexLast.
nBits = 0x1c387f6f;
76 unsigned int nBits{~0x00800000U};
119 std::vector<CBlockIndex> blocks(10000);
120 for (
int i = 0; i < 10000; i++) {
121 blocks[i].pprev = i ? &blocks[i - 1] :
nullptr;
122 blocks[i].nHeight = i;
123 blocks[i].nTime = 1269211443 + i * chainParams->GetConsensus().nPowTargetSpacing;
124 blocks[i].nBits = 0x207fffff;
128 for (
int j = 0; j < 1000; j++) {
141 const auto consensus = chainParams->GetConsensus();
144 BOOST_CHECK_EQUAL(consensus.hashGenesisBlock, chainParams->GenesisBlock().GetHash());
147 BOOST_CHECK_EQUAL(consensus.nPowTargetTimespan % consensus.nPowTargetSpacing, 0);
152 pow_compact.
SetCompact(chainParams->GenesisBlock().nBits, &neg, &over);
158 if (!consensus.fPowNoRetargeting) {
159 arith_uint256 targ_max(
"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
160 targ_max /= consensus.nPowTargetTimespan*4;