Changeset View
Changeset View
Standalone View
Standalone View
src/test/txindex_tests.cpp
Show All 31 Lines | BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup) { | ||||
txindex.Start(); | txindex.Start(); | ||||
// Allow tx index to catch up with the block index. | // Allow tx 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 (!txindex.BlockUntilSyncedToCurrentChain()) { | while (!txindex.BlockUntilSyncedToCurrentChain()) { | ||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis()); | BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis()); | ||||
MilliSleep(100); | UninterruptibleSleep(std::chrono::milliseconds{100}); | ||||
} | } | ||||
// Check that txindex excludes genesis block transactions. | // Check that txindex excludes genesis block transactions. | ||||
const CBlock &genesis_block = Params().GenesisBlock(); | const CBlock &genesis_block = Params().GenesisBlock(); | ||||
for (const auto &txn : genesis_block.vtx) { | for (const auto &txn : genesis_block.vtx) { | ||||
BOOST_CHECK(!txindex.FindTx(txn->GetId(), block_hash, tx_disk)); | BOOST_CHECK(!txindex.FindTx(txn->GetId(), block_hash, tx_disk)); | ||||
} | } | ||||
Show All 36 Lines |