Changeset View
Changeset View
Standalone View
Standalone View
src/test/blockfilter_index_tests.cpp
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, TestChain100Setup) { | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
tip = ::ChainActive().Tip(); | tip = ::ChainActive().Tip(); | ||||
} | } | ||||
CScript coinbase_script_pub_key = | CScript coinbase_script_pub_key = | ||||
GetScriptForDestination(PKHash(coinbaseKey.GetPubKey())); | GetScriptForDestination(PKHash(coinbaseKey.GetPubKey())); | ||||
std::vector<std::shared_ptr<CBlock>> chainA, chainB; | std::vector<std::shared_ptr<CBlock>> chainA, chainB; | ||||
BOOST_REQUIRE( | BOOST_REQUIRE( | ||||
BuildChain(tip, coinbase_script_pub_key, 10, chainA, ::g_mempool)); | BuildChain(tip, coinbase_script_pub_key, 10, chainA, *m_node.mempool)); | ||||
BOOST_REQUIRE( | BOOST_REQUIRE( | ||||
BuildChain(tip, coinbase_script_pub_key, 10, chainB, ::g_mempool)); | BuildChain(tip, coinbase_script_pub_key, 10, chainB, *m_node.mempool)); | ||||
// Check that new blocks on chain A get indexed. | // Check that new blocks on chain A get indexed. | ||||
uint256 chainA_last_header = last_header; | uint256 chainA_last_header = last_header; | ||||
for (size_t i = 0; i < 2; i++) { | for (size_t i = 0; i < 2; i++) { | ||||
const auto &block = chainA[i]; | const auto &block = chainA[i]; | ||||
BOOST_REQUIRE(ProcessNewBlock(GetConfig(), block, true, nullptr)); | BOOST_REQUIRE(ProcessNewBlock(GetConfig(), block, true, nullptr)); | ||||
const CBlockIndex *block_index; | const CBlockIndex *block_index; | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |