Ensure m_tip_block is never ZERO

To avoid future code changes from reintroducing the ambiguity fixed
by the previous commit, mark m_tip_block private and Assume that
it's not set to uint256::ZERO.
This commit is contained in:
Sjors Provoost
2024-12-17 09:43:22 +07:00
parent e058544d0e
commit 81cea5d4ee
5 changed files with 15 additions and 5 deletions

View File

@@ -72,8 +72,8 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)
ChainstateManager& chainman = *Assert(m_node.chainman);
const auto get_notify_tip{[&]() {
LOCK(m_node.notifications->m_tip_block_mutex);
BOOST_REQUIRE(m_node.notifications->m_tip_block);
return *m_node.notifications->m_tip_block;
BOOST_REQUIRE(m_node.notifications->TipBlock());
return *m_node.notifications->TipBlock();
}};
uint256 curr_tip = get_notify_tip();