Wallet picker shows one wallet twice when its name ends in / #1101

Open
opened 2026-11-10 14:08:25 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-10 14:08:25 +00:00 (Migrated from github.com)

Creating a wallet with a name ending in / makes the wallet picker show two entries for the same database: one open and one closed. Selecting the closed entry attempts to open the already-loaded wallet and produces a database-lock error.

Related completed wallet-picker work: #698 and #571. Both are closed, so this reports the remaining case separately.

To reproduce:

  1. In regtest, choose Add wallet → Single-key wallet and create a wallet named trail2/.
  2. Open the wallet picker. It shows trail2/ under Open wallets and trail2 under Closed wallets.
  3. Select the closed trail2 entry. Opening fails with “Unable to obtain an exclusive lock on the database,” and the row shows an error.
  4. Quit and restart while trail2/ remains the wallet's startup name. Both entries return, and selecting the closed twin produces the same error.

Core's listwallets reports the loaded name as trail2/, while listwalletdir reports the directory as trail2. WalletListModel combines those lists using exact string equality, so it treats the two names as separate wallets. Core correctly refuses the second attempt to open the same database; QML incorrectly offers it as a closed wallet.

The picker should identify the accepted wallet name consistently and show one entry with the correct loaded state.

The original wallet remains usable. Closing trail2/ and reopening it as trail2 restores a single healthy entry. Plain names and names with an internal separator, such as sub/nested, produced one entry in the controls.

Reproduced in the native macOS GUI with Qt 6.9 at QML d567e3eb2497 / Core dc282ff31d1c, including restart and recovery. Current merged QML eed1f426fcb6 / Core 44901d8f64cb were checked in source and retain the same identity mismatch; this case was not rerun on that later revision.

Creating a wallet with a name ending in `/` makes the wallet picker show two entries for the same database: one open and one closed. Selecting the closed entry attempts to open the already-loaded wallet and produces a database-lock error. Related completed wallet-picker work: [#698](https://github.com/bitcoin-core/gui-qml/issues/698) and [#571](https://github.com/bitcoin-core/gui-qml/issues/571). Both are closed, so this reports the remaining case separately. To reproduce: 1. In regtest, choose **Add wallet → Single-key wallet** and create a wallet named `trail2/`. 2. Open the wallet picker. It shows `trail2/` under **Open wallets** and `trail2` under **Closed wallets**. 3. Select the closed `trail2` entry. Opening fails with “Unable to obtain an exclusive lock on the database,” and the row shows an error. 4. Quit and restart while `trail2/` remains the wallet's startup name. Both entries return, and selecting the closed twin produces the same error. Core's `listwallets` reports the loaded name as `trail2/`, while `listwalletdir` reports the directory as `trail2`. `WalletListModel` combines those lists using exact string equality, so it treats the two names as separate wallets. Core correctly refuses the second attempt to open the same database; QML incorrectly offers it as a closed wallet. The picker should identify the accepted wallet name consistently and show one entry with the correct loaded state. The original wallet remains usable. Closing `trail2/` and reopening it as `trail2` restores a single healthy entry. Plain names and names with an internal separator, such as `sub/nested`, produced one entry in the controls. Reproduced in the native macOS GUI with Qt 6.9 at QML `d567e3eb2497` / Core `dc282ff31d1c`, including restart and recovery. Current merged QML `eed1f426fcb6` / Core `44901d8f64cb` were checked in source and retain the same identity mismatch; this case was not rerun on that later revision.
Sign in to join this conversation.
No description provided.