Skip to content

fix: add .dat file extension automatically when exporting watchonly - #957

Open
polespinasa wants to merge 2 commits into
bitcoin-core:masterfrom
polespinasa:2026-08-05-fileextencionwatchonlywallet
Open

fix: add .dat file extension automatically when exporting watchonly#957
polespinasa wants to merge 2 commits into
bitcoin-core:masterfrom
polespinasa:2026-08-05-fileextencionwatchonlywallet

Conversation

@polespinasa

@polespinasa polespinasa commented Aug 5, 2026

Copy link
Copy Markdown
Member

fixes #956

Unlike backup wallet, export watch-only wallet was not automatically adding the file extension to the exported file, making restoring difficult if the user doesn't manually add the file extension after exporting.

Allows also to restore a wallet from a non specified .dat file extension. This is achieved by removing the filter in the select file screen, matching the RPC behavior.

@DrahtBot

DrahtBot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK achow101

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@hebasto hebasto changed the title gui: fix add .dat file extension automatically when exporting watchonly fix: add .dat file extension automatically when exporting watchonly Aug 8, 2026
@hebasto

hebasto commented Aug 8, 2026

Copy link
Copy Markdown
Member

Unlike backup wallet, export watch-only wallet was not automatically adding the file extension to the exported file, making restoring difficult if the user doesn't manually add the file extension after exporting.

As I noted here:

The GUI behaviour is consistent with the RPC.

This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

@polespinasa

Copy link
Copy Markdown
Member Author

This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

Right, probably more correct to say partially-fixes, this PRs tries to mimic what backup wallet does. Which does add the file extension by default when using the gui.

I think the normal non-technical user (will never use the RPC) workflow is just using the GUI options, and that should not imply adding some unknown data file extensions manually. A user might not know what a .dat is. Adding it by default seems the correct way to me.

@polespinasa

Copy link
Copy Markdown
Member Author

This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

Now it does :)

Second commit allows to load a non .dat file. Force file type filtering might cause the issue reported in #956, thus breaking UX.

Still I think the first commit is good as adding the file extension is normally good expected behavior and is what the GUI already does with backup wallet.

@polespinasa
polespinasa force-pushed the 2026-08-05-fileextencionwatchonlywallet branch from 9b2dfc5 to 10ea03e Compare August 11, 2026 11:02
@achow101

Copy link
Copy Markdown
Member

ACK 10ea03e

Comment thread src/qt/bitcoingui.cpp
appMenuBar = menuBar();

// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));

This comment was marked as low quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export Watch only missing .dat file extension

5 participants