mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 14:11:39 +00:00
wallet: warn when encryption cleanup fails #36793
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36793
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/wallet-encryption-rewrite-warning"
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?
Problem: Wallet encryption ignores a failed database rewrite after encrypted key records have been committed.
Old plaintext key material can remain in unused pages without a warning.
Fix: Log the cleanup failure while preserving the successful encryption result.
The warning advises moving funds to a newly created wallet before relying on at-rest encryption.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
🔵 Suggestion · Encryption callers do not receive the cleanup warning
When cleanup fails, the encryptwallet RPC and GUI encryption dialog still show their normal success messages without the move-funds advice.
Location:
src/wallet/wallet.cpp:901(head).🔵 Suggestion · Cleanup advice unnecessarily alarms born-encrypted wallets
A rewrite failure during passphrase-protected wallet creation triggers unnecessary move-funds advice, and the advice does not specify creating the replacement with a passphrase.
Location:
src/wallet/wallet.cpp:901(head).🔵 Suggestion · Rewrite-failure test omits committed key-record assertions
The new test checks cached wallet state after rewrite failure but does not directly check the committed key records that justify returning success.
Location:
src/wallet/test/wallet_tests.cpp:203(head).Review coverage was incomplete.
Reviewed:
5f7f18b07a1c· Full review report · Previous reportspermalink
I prefer that we simply drop this code once
encryptwalletis dropped altogether.Or alternatively, we do a RAII thing that turns on/off
secure_deleteas needed, rather than requiring the caller to useVACUUMafterwards which can fail.Prefer #36796
Agree with @achow101. Resolving #36027 will remove most of these "post-commit" arms including #35966
Thanks for the comments!