mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
refactor: Remove call to ShutdownRequested from IndexWaitSynced
Use the node interrupt object instead. There is no change in behavior in this commit.
This commit is contained in:
@@ -5,16 +5,16 @@
|
||||
#include <test/util/index.h>
|
||||
|
||||
#include <index/base.h>
|
||||
#include <shutdown.h>
|
||||
#include <util/check.h>
|
||||
#include <util/signalinterrupt.h>
|
||||
#include <util/time.h>
|
||||
|
||||
void IndexWaitSynced(const BaseIndex& index)
|
||||
void IndexWaitSynced(const BaseIndex& index, const util::SignalInterrupt& interrupt)
|
||||
{
|
||||
while (!index.BlockUntilSyncedToCurrentChain()) {
|
||||
// Assert shutdown was not requested to abort the test, instead of looping forever, in case
|
||||
// there was an unexpected error in the index that caused it to stop syncing and request a shutdown.
|
||||
Assert(!ShutdownRequested());
|
||||
Assert(!interrupt);
|
||||
|
||||
UninterruptibleSleep(100ms);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
#define BITCOIN_TEST_UTIL_INDEX_H
|
||||
|
||||
class BaseIndex;
|
||||
namespace util {
|
||||
class SignalInterrupt;
|
||||
} // namespace util
|
||||
|
||||
/** Block until the index is synced to the current chain */
|
||||
void IndexWaitSynced(const BaseIndex& index);
|
||||
void IndexWaitSynced(const BaseIndex& index, const util::SignalInterrupt& interrupt);
|
||||
|
||||
#endif // BITCOIN_TEST_UTIL_INDEX_H
|
||||
|
||||
Reference in New Issue
Block a user