mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
"Close wallet" says nothing about pruning: a wallet left closed on a pruned node can later not be opened without re-downloading the chain #1127
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1127
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Close wallet confirmation says only
Do you want to close the wallet "<name>"?. On a pruned node, a wallet that stays closed while the node connects more blocks than it keeps cannot be opened again without re-downloading the chain, and the app does not say so beforehand. Bitcoin-Qt's confirmation carries that warning.To reproduce, on a regtest node started with
-prune=1 -fastprune:savingsanddailyopen, open the wallet picker, choose … on thesavingsrow, then Close wallet, and confirm.savingswas closed (pruneblockchain; the wallet was closed at height 103 andpruneheightbecame 504).savingsin the picker.A popup says "Failed to open wallet" with Core's text "Wallet loading failed. Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of a pruned node)", and the row turns red.
loadwalletreturns error -4 with the same sentence.savings, closed from the row menuspare, closed with File → Close Wallet…daily, left open through the same blocks and prunesavingsclosed and reopened at oncesavingsreopens after the 700 blocksbitcoindalone: unload, 700 blocks, prune past itThe refusal is Core's and correct, and nothing is lost: the wallet file is intact and loads on a node that has the blocks. What is missing is the sentence before the fact. This is the whole popup:
github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/pages/wallet/DesktopWallets.qml (L586-L606)Bitcoin-Qt adds, by its source (walletcontroller.cpp#L94-L95): "Closing the wallet for too long can result in having to resync the entire chain if pruning is enabled."
With the app's reduced-storage default (2 GB, saved as
prune=1907) the node keeps about a week of blocks on mainnet, or about 3 days if every block were full. That is arithmetic from Core's source and assumed block sizes, not a measurement. What counts is the blocks connected while the wallet is not loaded.Closed #574 listed "Include pruning/resync warning text when appropriate for the selected release behavior". #727 added the confirmation and closed it. I found no discussion of the sentence there, and it was never in the QML.
Suggested: add the pruning sentence to the confirmation, at least when the node is pruned. Optionally, when a load fails with this error, say that the wallet file is intact; today the only instruction on screen is a command-line option the app has no control for. Related: the restore case on #947, and the storage texts in #1075 and #1050.
Reproduced on
qt6at2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and native, and offscreen ateed1f426fcb6. Limits:pruneblockchain), standing in for the automatic pruning of a 2 GB node.