File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,25 @@ static void TestBlockSubsidyHalvings(int nSubsidyHalvingInterval)
45
45
TestBlockSubsidyHalvings (consensusParams);
46
46
}
47
47
48
+ BOOST_AUTO_TEST_CASE (checkpoint_sanity)
49
+ {
50
+ const auto chainParams = CreateChainParams (*m_node.args , ChainType::MAIN);
51
+ const auto & checkpoints = chainParams->Checkpoints ();
52
+
53
+ uint256 p11111 = uint256S (" 0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d" );
54
+ uint256 p134444 = uint256S (" 0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe" );
55
+ BOOST_CHECK (checkpoints.CheckBlock (11111 , p11111));
56
+ BOOST_CHECK (checkpoints.CheckBlock (134444 , p134444));
57
+
58
+ // Wrong hashes at checkpoints should fail:
59
+ BOOST_CHECK (!checkpoints.CheckBlock (11111 , p134444));
60
+ BOOST_CHECK (!checkpoints.CheckBlock (134444 , p11111));
61
+
62
+ // ... but any hash not at a checkpoint should succeed:
63
+ BOOST_CHECK (checkpoints.CheckBlock (11111 +1 , p134444));
64
+ BOOST_CHECK (checkpoints.CheckBlock (134444 +1 , p11111));
65
+ }
66
+
48
67
BOOST_AUTO_TEST_CASE (block_subsidy_test)
49
68
{
50
69
const auto chainParams = CreateChainParams (*m_node.args , ChainType::MAIN);
You can’t perform that action at this time.
0 commit comments