Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,390 Lines • ▼ Show 20 Lines | while (true) { | ||||
// Copy wallet file. | // Copy wallet file. | ||||
boost::filesystem::path pathSrc = GetDataDir() / strWalletFile; | boost::filesystem::path pathSrc = GetDataDir() / strWalletFile; | ||||
boost::filesystem::path pathDest(strDest); | boost::filesystem::path pathDest(strDest); | ||||
if (boost::filesystem::is_directory(pathDest)) { | if (boost::filesystem::is_directory(pathDest)) { | ||||
pathDest /= strWalletFile; | pathDest /= strWalletFile; | ||||
} | } | ||||
try { | try { | ||||
if (boost::filesystem::equivalent(pathSrc, pathDest)) { | |||||
LogPrintf("cannot backup to wallet source file %s\n", | |||||
pathDest.string()); | |||||
return false; | |||||
} | |||||
#if BOOST_VERSION >= 104000 | #if BOOST_VERSION >= 104000 | ||||
boost::filesystem::copy_file( | boost::filesystem::copy_file( | ||||
pathSrc, pathDest, | pathSrc, pathDest, | ||||
boost::filesystem::copy_option::overwrite_if_exists); | boost::filesystem::copy_option::overwrite_if_exists); | ||||
#else | #else | ||||
boost::filesystem::copy_file(pathSrc, pathDest); | boost::filesystem::copy_file(pathSrc, pathDest); | ||||
#endif | #endif | ||||
LogPrintf("copied %s to %s\n", strWalletFile, | LogPrintf("copied %s to %s\n", strWalletFile, | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |