From f632d3391258fdcabf4d6939d8cc5537918169f6 Mon Sep 17 00:00:00 2001 From: Ray Engelking Date: Sun, 21 Jan 2018 07:53:16 -0500 Subject: [PATCH] Miner tests now have 110 nonces; difficulty readjusted after 90 blocks in test --- src/test/miner_tests.cpp | 66 +++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 949d7536c..31c9242c9 100755 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -43,40 +43,34 @@ struct { unsigned char extranonce; unsigned int nonce; } blockinfo[] = { - {4, 0x00449be3}, {2, 0x0007b5d4}, {1, 0x00277b25}, {1, 0x00554a73}, - {2, 0x000f50c3}, {2, 0x00058d80}, {1, 0x00087eb0}, {2, 0x0005533b}, - {2, 0x00160a2b}, {1, 0x00112185}, {1, 0x0008ef83}, {2, 0x000d744f}, - {2, 0x00023c4b}, {1, 0x001fb99c}, {2, 0x00097260}, {2, 0x000087f0}, - {1, 0x000ef006}, {2, 0x000a891e}, {1, 0x00146799}, {1, 0x00052fe5}, - {3, 0x000ccafb}, {2, 0x0004ed6e}, {2, 0x000670e2}, {1, 0x00032442}, -// {4, 0xa4ad9f65}, {2, 0x15cf2b27}, {1, 0x037620ac}, {1, 0x700d9c54}, -// {2, 0xce79f74f}, {2, 0x52d9c194}, {1, 0x77bc3efc}, {2, 0xbb62c5e8}, -// {2, 0x83ff997a}, {1, 0x48b984ee}, {1, 0xef925da0}, {2, 0x680d2979}, -// {2, 0x08953af7}, {1, 0x087dd553}, {2, 0x210e2818}, {2, 0xdfffcdef}, -// {1, 0xeea1b209}, {2, 0xba4a8943}, {1, 0xa7333e77}, {1, 0x344f3e2a}, -// {3, 0xd651f08e}, {2, 0xeca3957f}, {2, 0xca35aa49}, {1, 0x6bb2065d}, -// {2, 0x0170ee44}, {1, 0x6e12f4aa}, {2, 0x43f4f4db}, {2, 0x279c1c44}, -// {2, 0xb5a50f10}, {2, 0xb3902841}, {2, 0xd198647e}, {2, 0x6bc40d88}, -// {1, 0x633a9a1c}, {2, 0x9a722ed8}, {2, 0x55580d10}, {1, 0xd65022a1}, -// {2, 0xa12ffcc8}, {1, 0x75a6a9c7}, {2, 0xfb7c80b7}, {1, 0xe8403e6c}, -// {1, 0xe34017a0}, {3, 0x659e177b}, {2, 0xba5c40bf}, {5, 0x022f11ef}, -// {1, 0xa9ab516a}, {5, 0xd0999ed4}, {1, 0x37277cb3}, {1, 0x830f735f}, -// {1, 0xc6e3d947}, {2, 0x824a0c1b}, {1, 0x99962416}, {1, 0x75336f63}, -// {1, 0xaacf0fea}, {1, 0xd6531aec}, {5, 0x7afcf541}, {5, 0x9d6fac0d}, -// {1, 0x4cf5c4df}, {1, 0xabe0f2a0}, {6, 0x4a3dac18}, {2, 0xf265febe}, -// {2, 0x1bc9f23f}, {1, 0xad49ab71}, {1, 0x9f2d8923}, {1, 0x15acb65d}, -// {2, 0xd1cecb52}, {2, 0xf856808b}, {1, 0x0fa96e29}, {1, 0xe063ecbc}, -// {1, 0x78d926c6}, {5, 0x3e38ad35}, {5, 0x73901915}, {1, 0x63424be0}, -// {1, 0x6d6b0a1d}, {2, 0x888ba681}, {2, 0xe96b0714}, {1, 0xb7fcaa55}, -// {2, 0x19c106eb}, {1, 0x5aa13484}, {2, 0x5bf4c2f3}, {2, 0x94d401dd}, -// {1, 0xa9bc23d9}, {1, 0x3a69c375}, {1, 0x56ed2006}, {5, 0x85ba6dbd}, -// {1, 0xfd9b2000}, {1, 0x2b2be19a}, {1, 0xba724468}, {1, 0x717eb6e5}, -// {1, 0x70de86d9}, {1, 0x74e23a42}, {1, 0x49e92832}, {2, 0x6926dbb9}, -// {0, 0x64452497}, {1, 0x54306d6f}, {2, 0x97ebf052}, {2, 0x55198b70}, -// {2, 0x03fe61f0}, {1, 0x98f9e67f}, {1, 0xc0842a09}, {1, 0xdfed39c5}, -// {1, 0x3144223e}, {1, 0xb3d12f84}, {1, 0x7366ceb7}, {5, 0x6240691b}, -// {2, 0xd3529b57}, {1, 0xf4cae3b1}, {1, 0x5b1df222}, {1, 0xa16a5c70}, -// {2, 0xbbccedc6}, {2, 0xfe38d0ef}, + {4, 0x00449be3}, {2, 0x0007b5d4}, {1, 0x00277b25}, {1, 0x00554a73}, + {2, 0x000f50c3}, {2, 0x00058d80}, {1, 0x00087eb0}, {2, 0x0005533b}, + {2, 0x00160a2b}, {1, 0x00112185}, {1, 0x0008ef83}, {2, 0x000d744f}, + {2, 0x00023c4b}, {1, 0x001fb99c}, {2, 0x00097260}, {2, 0x000087f0}, + {1, 0x000ef006}, {2, 0x000a891e}, {1, 0x00146799}, {1, 0x00052fe5}, + {3, 0x000ccafb}, {2, 0x0004ed6e}, {2, 0x000670e2}, {1, 0x00032442}, + {2, 0x000831aa}, {1, 0x00082314}, {2, 0x001e350b}, {2, 0x00029d0c}, + {2, 0x0006f6c5}, {2, 0x0001e264}, {2, 0x000a08fc}, {2, 0x0005e8fd}, + {1, 0x000e2f5a}, {2, 0x00278f06}, {2, 0x001571c0}, {1, 0x000914c8}, + {2, 0x000946cd}, {1, 0x0006a48e}, {2, 0x000703dc}, {1, 0x001fb141}, + {1, 0x000244f6}, {3, 0x000f34a5}, {2, 0x000e582a}, {5, 0x00052ef7}, + {1, 0x000357c6}, {5, 0x002698e9}, {1, 0x001d573a}, {1, 0x002b1eed}, + {1, 0x00182a29}, {2, 0x00065ef5}, {1, 0x001e35b2}, {1, 0x0009301d}, + {1, 0x002a8242}, {1, 0x000062ac}, {5, 0x0004e590}, {5, 0x0006e0c9}, + {1, 0x000b357c}, {1, 0x00028170}, {6, 0x00139368}, {2, 0x000dba0f}, + {2, 0x0004b940}, {1, 0x000728b5}, {1, 0x00069945}, {1, 0x00121a89}, + {2, 0x0003cabe}, {2, 0x001539d1}, {1, 0x0000d689}, {1, 0x0007b15a}, + {1, 0x00055a5a}, {5, 0x0008c0be}, {5, 0x0003b969}, {1, 0x000c1abe}, + {1, 0x00014887}, {2, 0x002fe501}, {2, 0x0001ee79}, {1, 0x0001509b}, + {2, 0x0005337e}, {1, 0x0016a8fd}, {2, 0x001707dc}, {2, 0x000d4204}, + {1, 0x0021ffb9}, {1, 0x001700ed}, {1, 0x000ff4a2}, {5, 0x0002e29a}, + {1, 0x0005752b}, {1, 0x002d1941}, {1, 0x0004b748}, {1, 0x000cc766}, + {1, 0x00fbfeab}, {1, 0x00280c63}, {1, 0x00301a9d}, {2, 0x0061ccd2}, + {0, 0x0083b4bb}, {1, 0x00465c79}, {2, 0x0073fc0f}, {2, 0x0042f1ad}, + {2, 0x0033b29b}, {1, 0x0019527b}, {1, 0x006e5bc6}, {1, 0x0000857a}, + {1, 0x0026861f}, {1, 0x00791950}, {1, 0x000af2bb}, {5, 0x00216237}, + {2, 0x000d6f4a}, {1, 0x0008b2e2}, {1, 0x002b7071}, {1, 0x00880133}, + {2, 0x007c30d6}, {2, 0x001024e2}, }; CBlockIndex CreateBlockIndex(int nHeight) @@ -231,6 +225,10 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) for (unsigned int i = 0; i < sizeof(blockinfo)/sizeof(*blockinfo); ++i) { CBlock *pblock = &pblocktemplate->block; // pointer for convenience + // FLO difficulty retargets every 90 blocks, hard coded for tests + if (i >= 89 ){ + pblock->nBits = 0x1e03fffc; + } pblock->nVersion = 1; pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; CMutableTransaction txCoinbase(*pblock->vtx[0]);