Skip to content

Commit

Permalink
https://github.com/PIVX-Project/PIVX/commit/62b2b5c082108e117b9300a46…
Browse files Browse the repository at this point in the history
…64a8ee12e5b1736

Do not use boost copy_file if Boost < 1.58 (presstab)"
  • Loading branch information
Graham Higgins committed Mar 28, 2017
1 parent d2b9a98 commit 4218e20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "walletdb.h"
#include "wallet.h"
#include <fstream>
#include <boost/filesystem.hpp>

using namespace std;
Expand Down Expand Up @@ -443,10 +444,12 @@ bool BackupWallet(const CWallet& wallet, const string& strDest)
pathDest /= wallet.strWalletFile;

try {
#if BOOST_VERSION >= 104000
#if BOOST_VERSION >= 158000
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
#else
filesystem::copy_file(pathSrc, pathDest);
std::ifstream src(pathSrc.string(), std::ios::binary);
std::ofstream dst(pathDest.string(), std::ios::binary);
dst << src.rdbuf();
#endif
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
return true;
Expand Down

0 comments on commit 4218e20

Please sign in to comment.