aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2024-03-07 10:44:52 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2024-03-08 19:40:11 -0300
commita951dba3a9d7663f009701140d663338e6c526a4 (patch)
tree2203324162de9efae336a7ebbe9cb3c259d874d6 /src/wallet/wallet.cpp
parentc2c6a7d1dc162945fa56deb6eaf2bdd7f84999e8 (diff)
downloadbitcoin-a951dba3a9d7663f009701140d663338e6c526a4.tar.xz
wallet: default wallet migration, modify inconvenient backup filename
On default legacy wallets, the backup filename starts with an "-" due to the wallet name being empty. This is inconvenient for systems who treat what follows the initial "-" character as flags.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 3ac09430d8..9c15c2a827 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4336,7 +4336,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
// Make a backup of the DB
fs::path this_wallet_dir = fs::absolute(fs::PathFromString(local_wallet->GetDatabase().Filename())).parent_path();
- fs::path backup_filename = fs::PathFromString(strprintf("%s-%d.legacy.bak", wallet_name, GetTime()));
+ fs::path backup_filename = fs::PathFromString(strprintf("%s_%d.legacy.bak", (wallet_name.empty() ? "default_wallet" : wallet_name), GetTime()));
fs::path backup_path = this_wallet_dir / backup_filename;
if (!local_wallet->BackupWallet(fs::PathToString(backup_path))) {
if (was_loaded) {