0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-25 12:51:55 -05:00
bitcoin-bitcoin-core/src/test/util/index.cpp

19 lines
534 B
C++
Raw Normal View History

// Copyright (c) 2020-2022 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <test/util/index.h>
#include <index/base.h>
#include <util/check.h>
#include <util/time.h>
void IndexWaitSynced(BaseIndex& index)
{
const auto timeout{SteadyClock::now() + 120s};
while (!index.BlockUntilSyncedToCurrentChain()) {
Assert(timeout > SteadyClock::now());
UninterruptibleSleep(100ms);
}
}