-
+ D1AED65F884867DDD9A8C6E3C032159F66AFC5B015E802F0DE9967C32C758E5C9F2F038754E314A88E1F816FAC461453274751B3296B31CC0E9AE15943A68EB5
bitcoin/src/test/Checkpoints_tests.cpp
(0 . 0)(1 . 65)
22629 // /****************************\
22630 // * EXPERIMENTAL BRANCH. *
22631 // * FOR LABORATORY USE ONLY. *
22632 // ********************************
22633 // ************
22634 // **************
22635 // ****************
22636 // **** **** ****
22637 // *** *** ***
22638 // *** *** ***
22639 // *** * * **
22640 // ******** ********
22641 // ******* ******
22642 // *** **
22643 // * ******* **
22644 // ** * * * * *
22645 // ** * * ***
22646 // **** * * * * ****
22647 // **** *** * * ** ***
22648 // **** ********* ******
22649 // ******* ***** *******
22650 // ********* ****** **
22651 // ** ****** ******
22652 // ** ******* **
22653 // ** ******* ***
22654 // **** ******** ************
22655 // ************ ************
22656 // ******** *******
22657 // ****** ****
22658 // *** ***
22659 // ********************************
22660 //
22661 // Unit tests for block-chain checkpoints
22662 //
22663 #include <boost/assign/list_of.hpp> // for 'map_list_of()'
22664 #include <boost/test/unit_test.hpp>
22665 #include <boost/foreach.hpp>
22666
22667 #include "../checkpoints.h"
22668 #include "../util.h"
22669
22670 using namespace std;
22671
22672 BOOST_AUTO_TEST_SUITE(Checkpoints_tests)
22673
22674 BOOST_AUTO_TEST_CASE(sanity)
22675 {
22676 uint256 p11111 = uint256("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d");
22677 uint256 p140700 = uint256("0x000000000000033b512028abb90e1626d8b346fd0ed598ac0a3c371138dce2bd");
22678 BOOST_CHECK(Checkpoints::CheckBlock(11111, p11111));
22679 BOOST_CHECK(Checkpoints::CheckBlock(140700, p140700));
22680
22681
22682 // Wrong hashes at checkpoints should fail:
22683 BOOST_CHECK(!Checkpoints::CheckBlock(11111, p140700));
22684 BOOST_CHECK(!Checkpoints::CheckBlock(140700, p11111));
22685
22686 // ... but any hash not at a checkpoint should succeed:
22687 BOOST_CHECK(Checkpoints::CheckBlock(11111+1, p140700));
22688 BOOST_CHECK(Checkpoints::CheckBlock(140700+1, p11111));
22689
22690 BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate() >= 140700);
22691 }
22692
22693 BOOST_AUTO_TEST_SUITE_END()