44//
55#include < chainparams.h>
66#include < consensus/validation.h>
7+ #include < node/kernel_notifications.h>
78#include < random.h>
89#include < rpc/blockchain.h>
910#include < sync.h>
@@ -69,14 +70,14 @@ BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
6970BOOST_FIXTURE_TEST_CASE (chainstate_update_tip, TestChain100Setup)
7071{
7172 ChainstateManager& chainman = *Assert (m_node.chainman );
72- uint256 curr_tip = ::g_best_block ;
73+ uint256 curr_tip = m_node. notifications -> m_tip_block ;
7374
7475 // Mine 10 more blocks, putting at us height 110 where a valid assumeutxo value can
7576 // be found.
7677 mineBlocks (10 );
7778
7879 // After adding some blocks to the tip, best block should have changed.
79- BOOST_CHECK (::g_best_block != curr_tip);
80+ BOOST_CHECK (m_node. notifications -> m_tip_block != curr_tip);
8081
8182 // Grab block 1 from disk; we'll add it to the background chain later.
8283 std::shared_ptr<CBlock> pblockone = std::make_shared<CBlock>();
@@ -91,15 +92,15 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)
9192 // Ensure our active chain is the snapshot chainstate.
9293 BOOST_CHECK (WITH_LOCK (::cs_main, return chainman.IsSnapshotActive ()));
9394
94- curr_tip = ::g_best_block ;
95+ curr_tip = m_node. notifications -> m_tip_block ;
9596
9697 // Mine a new block on top of the activated snapshot chainstate.
9798 mineBlocks (1 ); // Defined in TestChain100Setup.
9899
99100 // After adding some blocks to the snapshot tip, best block should have changed.
100- BOOST_CHECK (::g_best_block != curr_tip);
101+ BOOST_CHECK (m_node. notifications -> m_tip_block != curr_tip);
101102
102- curr_tip = ::g_best_block ;
103+ curr_tip = m_node. notifications -> m_tip_block ;
103104
104105 BOOST_CHECK_EQUAL (chainman.GetAll ().size (), 2 );
105106
@@ -138,7 +139,7 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)
138139 // g_best_block should be unchanged after adding a block to the background
139140 // validation chain.
140141 BOOST_CHECK (block_added);
141- BOOST_CHECK_EQUAL (curr_tip, ::g_best_block );
142+ BOOST_CHECK_EQUAL (curr_tip, m_node. notifications -> m_tip_block );
142143}
143144
144145BOOST_AUTO_TEST_SUITE_END ()
0 commit comments