mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 14:47:31 +02:00
kernel: remove btck_chain_get_tip
It is equivalent to calling btck_chain_get_by_height with the height obtained from btck_chain_get_height. In neither case do we provide guarantees that the returned block index still corresponds to the actual tip.
This commit is contained in:
@@ -676,7 +676,7 @@ void chainman_reindex_test(TestDirectory& test_directory)
|
||||
auto next_index{chain.GetByHeight(first_index.GetHeight() + 1)};
|
||||
BOOST_CHECK(chain.Contains(next_index));
|
||||
auto next_block_data{chainman->ReadBlock(next_index).value().ToBytes()};
|
||||
auto tip_index{chain.Tip()};
|
||||
auto tip_index{chain.Entries().back()};
|
||||
auto tip_block_data{chainman->ReadBlock(tip_index).value().ToBytes()};
|
||||
auto second_index{chain.GetByHeight(1)};
|
||||
auto second_block{chainman->ReadBlock(second_index).value()};
|
||||
@@ -755,7 +755,7 @@ void chainman_mainnet_validation_test(TestDirectory& test_directory)
|
||||
|
||||
auto chain{chainman->GetChain()};
|
||||
BOOST_CHECK_EQUAL(chain.Height(), 1);
|
||||
auto tip{chain.Tip()};
|
||||
auto tip{chain.Entries().back()};
|
||||
auto read_block{chainman->ReadBlock(tip)};
|
||||
BOOST_REQUIRE(read_block);
|
||||
check_equal(read_block.value().ToBytes(), raw_block);
|
||||
@@ -851,7 +851,7 @@ BOOST_AUTO_TEST_CASE(btck_chainman_regtest_tests)
|
||||
}
|
||||
|
||||
auto chain = chainman->GetChain();
|
||||
auto tip = chain.Tip();
|
||||
auto tip = chain.Entries().back();
|
||||
auto read_block = chainman->ReadBlock(tip).value();
|
||||
check_equal(read_block.ToBytes(), hex_string_to_byte_vec(REGTEST_BLOCK_DATA[REGTEST_BLOCK_DATA.size() - 1]));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user