mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 08:13:52 +02:00
Merge #13667: wallet: Fix backupwallet for multiwallets
a1a998cf24 wallet: Fix backupwallet for multiwallets (Daniel Kraft)
Pull request description:
`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.
Tree-SHA512: 7efe2450ca047e40719fcc7cc211ed94699056020ac737cada7b59e8240298675960570c45079add424d0aab520437d5050d956acd695a9c2452dd4317b4d2c4
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user