diff options
| author | Pieter Wuille <[email protected]> | 2016-05-25 18:06:23 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-05-25 18:08:06 +0200 |
| commit | f6b7df3155ddb4cedfbcf5d3eb3383d4614b3a85 (patch) | |
| tree | 3650807620c9f236f73fe68f75aecc68506ed892 /src/wallet/walletdb.cpp | |
| parent | Merge #8076: VerifyDB: don't check blocks that have been pruned (diff) | |
| parent | Move BackupWallet to CWallet::BackupWallet (diff) | |
| download | discoin-f6b7df3155ddb4cedfbcf5d3eb3383d4614b3a85.tar.xz discoin-f6b7df3155ddb4cedfbcf5d3eb3383d4614b3a85.zip | |
Merge #8061: [Wallet] Improve Wallet encapsulation
380498a Move BackupWallet to CWallet::BackupWallet (Patrick Strateman)
ecb9741 Move GetAccountBalance from rpcwallet.cpp into CWallet::GetAccountBalance (Patrick Strateman)
Diffstat (limited to 'src/wallet/walletdb.cpp')
| -rw-r--r-- | src/wallet/walletdb.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 48579b282..b5037c9a6 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -903,46 +903,6 @@ void ThreadFlushWalletDB(const string& strFile) } } -bool BackupWallet(const CWallet& wallet, const string& strDest) -{ - if (!wallet.fFileBacked) - return false; - while (true) - { - { - LOCK(bitdb.cs_db); - if (!bitdb.mapFileUseCount.count(wallet.strWalletFile) || bitdb.mapFileUseCount[wallet.strWalletFile] == 0) - { - // Flush log data to the dat file - bitdb.CloseDb(wallet.strWalletFile); - bitdb.CheckpointLSN(wallet.strWalletFile); - bitdb.mapFileUseCount.erase(wallet.strWalletFile); - - // Copy wallet file - boost::filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; - boost::filesystem::path pathDest(strDest); - if (boost::filesystem::is_directory(pathDest)) - pathDest /= wallet.strWalletFile; - - try { -#if BOOST_VERSION >= 104000 - boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists); -#else - boost::filesystem::copy_file(pathSrc, pathDest); -#endif - LogPrintf("copied %s to %s\n", wallet.strWalletFile, pathDest.string()); - return true; - } catch (const boost::filesystem::filesystem_error& e) { - LogPrintf("error copying %s to %s - %s\n", wallet.strWalletFile, pathDest.string(), e.what()); - return false; - } - } - } - MilliSleep(100); - } - return false; -} - // // Try to (very carefully!) recover wallet file if there is a problem. // |