Files
bitcoin/src
furszy ac4d0956cc wallet: fix unnamed wallet migration failure
When migrating any legacy unnamed wallet, a failed migration would
cause the cleanup logic to remove its parent directory. Since this
type of legacy wallet lives directly in the main '/wallets/' folder,
this resulted in unintentionally erasing all wallets, including the
backup file.

To be fully safe, we will no longer call `fs::remove_all`. Instead,
we only erase the individual db files we have created, leaving
everything else intact. The created wallets parent directories are
erased only if they are empty.
As part of this last change, `RestoreWallet` was modified to allow
an existing directory as the destination, since we no longer remove
the original wallet directory (we only remove the files we created
inside it). This also fixes the restore of top-level default wallets
during failures, which were failing due to the directory existence
check that always returns true for the /wallets/ directory.

This bug started after:
f6ee59b6e2
Previously, the `fs::copy_file` call was failing for top-level wallets,
which prevented the `fs::remove_all` call from being reached.

Github-Pull: #34156
Rebased-From: f4c7e28e80
2026-01-07 11:19:35 +00:00
..
2025-05-08 16:49:58 +01:00
2025-09-08 18:39:55 +01:00
2025-09-07 17:28:31 +02:00
2025-11-26 16:49:06 +00:00
2025-11-05 09:52:41 +00:00
2025-05-19 16:40:33 +01:00
2025-09-03 11:23:30 +01:00
2025-05-20 09:30:41 +01:00
2024-11-26 20:47:08 -05:00
2025-05-19 16:40:33 +01:00
2026-01-05 12:07:02 +00:00
2025-08-12 11:28:36 -04:00
2025-08-12 11:28:36 -04:00
2025-09-23 10:20:05 -04:00
2024-05-20 16:48:19 +00:00
2024-07-08 11:12:01 +02:00
2025-06-03 08:09:21 +01:00
2025-05-21 10:44:26 -07:00
2025-05-21 10:44:26 -07:00
2025-05-08 16:49:58 +01:00
2025-04-09 15:59:59 +01:00
2025-04-09 15:59:59 +01:00