Changeset View
Changeset View
Standalone View
Standalone View
src/test/blockfilter_index_tests.cpp
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, TestChain100Setup) { | ||||
filter_index.Start(); | filter_index.Start(); | ||||
// Allow filter index to catch up with the block index. | // Allow filter index to catch up with the block index. | ||||
constexpr int64_t timeout_ms = 10 * 1000; | constexpr int64_t timeout_ms = 10 * 1000; | ||||
int64_t time_start = GetTimeMillis(); | int64_t time_start = GetTimeMillis(); | ||||
while (!filter_index.BlockUntilSyncedToCurrentChain()) { | while (!filter_index.BlockUntilSyncedToCurrentChain()) { | ||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis()); | BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis()); | ||||
MilliSleep(100); | UninterruptibleSleep(std::chrono::milliseconds{100}); | ||||
} | } | ||||
// Check that filter index has all blocks that were in the chain before it | // Check that filter index has all blocks that were in the chain before it | ||||
// started. | // started. | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
const CBlockIndex *block_index; | const CBlockIndex *block_index; | ||||
for (block_index = ::ChainActive().Genesis(); block_index != nullptr; | for (block_index = ::ChainActive().Genesis(); block_index != nullptr; | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |