diff options
Diffstat (limited to 'src/db.cpp')
-rw-r--r-- | src/db.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/db.cpp b/src/db.cpp index 3bdda61569..ea6d46a6e5 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -6,6 +6,7 @@ #include "headers.h" #include "db.h" #include "net.h" +#include <boost/version.hpp> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> @@ -939,6 +940,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet) ssValue >> nMinVersion; if (nMinVersion > CLIENT_VERSION) return DB_TOO_NEW; + pwallet->LoadMinVersion(nMinVersion); } else if (strType == "cscript") { @@ -1064,14 +1066,19 @@ bool BackupWallet(const CWallet& wallet, const string& strDest) filesystem::path pathDest(strDest); if (filesystem::is_directory(pathDest)) pathDest = pathDest / wallet.strWalletFile; + + try { #if BOOST_VERSION >= 104000 - filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); + filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); #else - filesystem::copy_file(pathSrc, pathDest); + filesystem::copy_file(pathSrc, pathDest); #endif - printf("copied wallet.dat to %s\n", pathDest.string().c_str()); - - return true; + printf("copied wallet.dat to %s\n", pathDest.string().c_str()); + return true; + } catch(const filesystem::filesystem_error &e) { + printf("error copying wallet.dat to %s - %s\n", pathDest.string().c_str(), e.what()); + return false; + } } } Sleep(100); |