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:
Ryan Ofsky
2023-07-07 17:32:54 -04:00
parent 42e5829d97
commit ba93966368
5 changed files with 11 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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