Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.cpp
Show First 20 Lines • Show All 806 Lines • ▼ Show 20 Lines | while (true) { | ||||
if (!fSuccess) { | if (!fSuccess) { | ||||
LogPrintf("BerkeleyBatch::Rewrite: Failed to rewrite " | LogPrintf("BerkeleyBatch::Rewrite: Failed to rewrite " | ||||
"database file %s\n", | "database file %s\n", | ||||
strFileRes); | strFileRes); | ||||
} | } | ||||
return fSuccess; | return fSuccess; | ||||
} | } | ||||
} | } | ||||
MilliSleep(100); | UninterruptibleSleep(std::chrono::milliseconds{100}); | ||||
} | } | ||||
} | } | ||||
void BerkeleyEnvironment::Flush(bool fShutdown) { | void BerkeleyEnvironment::Flush(bool fShutdown) { | ||||
int64_t nStart = GetTimeMillis(); | int64_t nStart = GetTimeMillis(); | ||||
// Flush log data to the actual data file on all files that are not in use | // Flush log data to the actual data file on all files that are not in use | ||||
LogPrint(BCLog::DB, "BerkeleyEnvironment::Flush: [%s] Flush(%s)%s\n", | LogPrint(BCLog::DB, "BerkeleyEnvironment::Flush: [%s] Flush(%s)%s\n", | ||||
strPath, fShutdown ? "true" : "false", | strPath, fShutdown ? "true" : "false", | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | while (true) { | ||||
} catch (const fs::filesystem_error &e) { | } catch (const fs::filesystem_error &e) { | ||||
LogPrintf("error copying %s to %s - %s\n", strFile, | LogPrintf("error copying %s to %s - %s\n", strFile, | ||||
pathDest.string(), | pathDest.string(), | ||||
fsbridge::get_filesystem_error_message(e)); | fsbridge::get_filesystem_error_message(e)); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
MilliSleep(100); | UninterruptibleSleep(std::chrono::milliseconds{100}); | ||||
} | } | ||||
} | } | ||||
void BerkeleyDatabase::Flush(bool shutdown) { | void BerkeleyDatabase::Flush(bool shutdown) { | ||||
if (!IsDummy()) { | if (!IsDummy()) { | ||||
env->Flush(shutdown); | env->Flush(shutdown); | ||||
if (shutdown) { | if (shutdown) { | ||||
LOCK(cs_db); | LOCK(cs_db); | ||||
Show All 19 Lines |