aboutsummaryrefslogtreecommitdiff
path: root/src/test/txindex_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/txindex_tests.cpp')
-rw-r--r--src/test/txindex_tests.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/test/txindex_tests.cpp b/src/test/txindex_tests.cpp
index b666517ae2..2677502ef0 100644
--- a/src/test/txindex_tests.cpp
+++ b/src/test/txindex_tests.cpp
@@ -6,8 +6,8 @@
#include <index/txindex.h>
#include <interfaces/chain.h>
#include <script/standard.h>
+#include <test/util/index.h>
#include <test/util/setup_common.h>
-#include <util/time.h>
#include <validation.h>
#include <boost/test/unit_test.hpp>
@@ -32,12 +32,7 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
BOOST_REQUIRE(txindex.Start());
// Allow tx index to catch up with the block index.
- constexpr auto timeout{10s};
- const auto time_start{SteadyClock::now()};
- while (!txindex.BlockUntilSyncedToCurrentChain()) {
- BOOST_REQUIRE(time_start + timeout > SteadyClock::now());
- UninterruptibleSleep(std::chrono::milliseconds{100});
- }
+ IndexWaitSynced(txindex);
// Check that txindex excludes genesis block transactions.
const CBlock& genesis_block = Params().GenesisBlock();