Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.cpp
Show First 20 Lines • Show All 832 Lines • ▼ Show 20 Lines | while (true) { | ||||
if (!env->mapFileUseCount.count(strFile) || | if (!env->mapFileUseCount.count(strFile) || | ||||
env->mapFileUseCount[strFile] == 0) { | env->mapFileUseCount[strFile] == 0) { | ||||
// Flush log data to the dat file | // Flush log data to the dat file | ||||
env->CloseDb(strFile); | env->CloseDb(strFile); | ||||
env->CheckpointLSN(strFile); | env->CheckpointLSN(strFile); | ||||
env->mapFileUseCount.erase(strFile); | env->mapFileUseCount.erase(strFile); | ||||
// Copy wallet file. | // Copy wallet file. | ||||
fs::path pathSrc = GetWalletDir() / strFile; | fs::path pathSrc = env->Directory() / strFile; | ||||
fs::path pathDest(strDest); | fs::path pathDest(strDest); | ||||
if (fs::is_directory(pathDest)) { | if (fs::is_directory(pathDest)) { | ||||
pathDest /= strFile; | pathDest /= strFile; | ||||
} | } | ||||
try { | try { | ||||
if (fs::equivalent(pathSrc, pathDest)) { | if (fs::equivalent(pathSrc, pathDest)) { | ||||
LogPrintf("cannot backup to wallet source file %s\n", | LogPrintf("cannot backup to wallet source file %s\n", | ||||
Show All 27 Lines |