MCPcopy Create free account
hub / github.com/bcndev/bytecoin / test_print_tips

Method test_print_tips

src/Core/BlockChain.cpp:810–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808}
809
810void BlockChain::test_print_tips() const {
811 CumulativeDifficulty ocd;
812 Hash obid;
813 if (get_oldest_tip(&ocd, &obid))
814 std::cout << "oldest tip cd=" << ocd << " bid=" << obid << std::endl;
815 std::cout << "---- BlockTree structure ----" << std::endl;
816 for (DB::Cursor cur = m_db.begin(CHILDREN_PREFIX); !cur.end(); cur.next()) {
817 Hash bid;
818 DB::from_binary_key(cur.get_suffix(), 0, bid.data, sizeof(bid.data));
819 size_t counter = 1;
820 seria::from_binary(counter, cur.get_value_array());
821 api::BlockHeader info = read_header(bid);
822 std::cout << "branch height=" << info.height << " bid=" << bid << " children=" << counter << std::endl;
823 }
824 for_each_tip([&](CumulativeDifficulty cd, Hash bid) -> bool {
825 api::BlockHeader info = read_header(bid);
826 std::cout << "tip height=" << info.height << " bid=" << bid << " CD=" << cd << std::endl;
827 return true;
828 });
829}
830
831void BlockChain::test_print_structure(Height n_confirmations) const {
832 CumulativeDifficulty ocd;

Callers

nothing calls this directly

Calls 5

from_binaryFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
nextMethod · 0.45
get_value_arrayMethod · 0.45

Tested by

no test coverage detected