From a1a998cf24c0cf1232e44ec8eaf2ad6875ab5153 Mon Sep 17 00:00:00 2001 From: Daniel Kraft Date: Sun, 15 Jul 2018 11:17:50 +0200 Subject: 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. --- src/wallet/db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3