diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp index 02fbddf88..97ae45302 100644 --- a/src/index/txindex.cpp +++ b/src/index/txindex.cpp @@ -152,7 +152,6 @@ bool TxIndex::DB::MigrateData(CBlockTreeDB& block_tree_db, const CBlockLocator& bool interrupted = false; std::unique_ptr cursor(block_tree_db.NewIterator()); for (cursor->Seek(begin_key); cursor->Valid(); cursor->Next()) { - std::this_thread::yield();; if (ShutdownRequested()) { interrupted = true; break; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 339092d2b..54d8c6509 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -838,7 +838,6 @@ static bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) uint256 prevkey; std::map outputs; while (pcursor->Valid()) { - std::this_thread::yield(); COutPoint key; Coin coin; if (pcursor->GetKey(key) && pcursor->GetValue(coin)) { @@ -1831,7 +1830,6 @@ bool FindScriptPubKey(std::atomic& scan_progress, const std::atomic& Coin coin; if (!cursor->GetKey(key) || !cursor->GetValue(coin)) return false; if (++count % 8192 == 0) { - std::this_thread::yield(); if (should_abort) { // allow to abort the scan via the abort reference return false; diff --git a/src/txdb.cpp b/src/txdb.cpp index 137f9798d..b2cb0a98f 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -278,7 +278,6 @@ bool CBlockTreeDB::LoadBlockIndexGuts(std::functionValid()) { - std::this_thread::yield();; std::pair key; if (pcursor->GetKey(key) && key.first == DB_BLOCK_INDEX) { CDiskBlockIndex diskindex; @@ -389,7 +388,6 @@ bool CCoinsViewDB::Upgrade() { std::pair key; std::pair prev_key = {DB_COINS, uint256()}; while (pcursor->Valid()) { - std::this_thread::yield();; if (ShutdownRequested()) { break; } diff --git a/src/validation.cpp b/src/validation.cpp index d042d02c3..25af608d9 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2613,8 +2613,6 @@ bool CChainState::ActivateBestChain(CValidationState &state, std::shared_ptr 10) { // Block until the validation queue drains. This should largely // never happen in normal operation, however may happen during @@ -3680,8 +3678,6 @@ bool CChainState::LoadBlockIndex(CBlockTreeDB& blocktree) if (!blocktree.LoadBlockIndexGuts([this](const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { return this->InsertBlockIndex(hash); })) return false; - std::this_thread::yield();; - std::vector > vSortedByHeight; vSortedByHeight.reserve(mapBlockIndex.size()); for (const std::pair& item : mapBlockIndex) @@ -3840,7 +3836,6 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth int reportDone = 0; LogPrintf("[0%%]..."); /* Continued */ for (pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev) { - std::this_thread::yield();; int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))); if (reportDone < percentageDone/10) { // report every 10% step @@ -3898,7 +3893,6 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth // check level 4: try reconnecting blocks if (nCheckLevel >= 4) { while (pindex != chainActive.Tip()) { - std::this_thread::yield();; uiInterface.ShowProgress(_("Verifying blocks..."), std::max(1, std::min(99, 100 - (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * 50))), false); pindex = chainActive.Next(pindex); CBlock block; @@ -4186,8 +4180,6 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp, CXFieldHistoryMap* CBufferedFile blkdat(fileIn, 2*GetCurrentMaxBlockSize(), GetCurrentMaxBlockSize()+8, SER_DISK, CLIENT_VERSION); uint64_t nRewind = blkdat.GetPos(); while (!blkdat.eof()) { - std::this_thread::yield();; - LogPrint(BCLog::REINDEX, "%s: nRewind : %d (%s out of order)\n", __func__, nRewind, outOfOrder ? "after" : "before"); blkdat.SetPos(nRewind); diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index e8da5ba18..414d24d53 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -129,8 +129,6 @@ bool BerkeleyEnvironment::Open(bool retry) if (fDbEnvInit) return true; - std::this_thread::yield();; - fs::path pathIn = strPath; TryCreateDirectories(pathIn); if (!LockDirectory(pathIn, ".walletlock")) { @@ -203,8 +201,6 @@ void BerkeleyEnvironment::MakeMock() if (fDbEnvInit) throw std::runtime_error("BerkeleyEnvironment::MakeMock: Already initialized"); - std::this_thread::yield();; - LogPrint(BCLog::DB, "BerkeleyEnvironment::MakeMock\n"); dbenv->set_cachesize(1, 0, 1); @@ -725,7 +721,6 @@ bool BerkeleyBatch::PeriodicFlush(BerkeleyDatabase& database) if (nRefCount == 0) { - std::this_thread::yield();; std::map::iterator mi = env->mapFileUseCount.find(strFile); if (mi != env->mapFileUseCount.end()) {