aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2018-07-15 11:17:50 +0200
committerDaniel Kraft <d@domob.eu>2018-07-15 16:38:33 +0200
commita1a998cf24c0cf1232e44ec8eaf2ad6875ab5153 (patch)
tree6249e34b5f3cdd184eaba9425371d028d157bd2e /src/wallet
parent8803c9132a78d8182bd828a29f7051fc7688f934 (diff)
downloadbitcoin-a1a998cf24c0cf1232e44ec8eaf2ad6875ab5153.tar.xz
wallet: Fix backupwallet for multiwallets
backupwallet was broken for multiwallets in their own directories (i.e. something like DATADIR/wallets/mywallet/wallet.dat). In this case, the backup would use DATADIR/wallets/wallet.dat as source file and not take the specific wallet's directory into account. This led to either an error during the backup (if the wrong source file was not present) or would silently back up the wrong wallet; especially the latter behaviour can be quite bad for users.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/db.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index 01b8eacccb..00964b8cc8 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -768,7 +768,7 @@ bool BerkeleyDatabase::Backup(const std::string& strDest)
env->mapFileUseCount.erase(strFile);
// Copy wallet file
- fs::path pathSrc = GetWalletDir() / strFile;
+ fs::path pathSrc = env->Directory() / strFile;
fs::path pathDest(strDest);
if (fs::is_directory(pathDest))
pathDest /= strFile;