You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When descriptor ECDSA keys are encrypted, a failed write or a failed erase of the plaintext record is ignored. If either fails, the wallet reports itself encrypted while a plaintext private-key record stays in the file.
Observed
At 1.x.xb27130a7b9, found by reading the code during review of the #283 fix. Not reproduced.
WalletBatch::WriteCryptedDescriptorKey (src/wallet/walletdb.cpp:235-242) ignores the result of erasing the plaintext walletdescriptorkey record and returns true.
DescriptorScriptPubKeyMan::Encrypt ignores the result of WriteCryptedDescriptorKey itself (src/wallet/scriptpubkeyman.cpp:1089).
Low. It needs a statement-level SQLite failure that does not abort the transaction. Failures that roll back the whole transaction, such as a full disk or an I/O error, make the commit fail instead.
Suggested fix
Have WriteCryptedDescriptorKey return the erase result, and check it in Encrypt, the same way the #283 fix does for PQC keys.
Fixed on 1.x.x by #418 (e9f4499aba), which ships in v1.0.1: WalletBatch::WriteCryptedDescriptorKey now returns the result of erasing the plaintext record, and DescriptorScriptPubKeyMan::Encrypt fails when that call fails, so the failure goes through EncryptWallet's abort path, as it already did for PQC keys. Test: wallet_encryption_tests/FailedKeyRecordWriteOrEraseFailsEncryption.
Closing by hand, because a merge into 1.x.x does not close issues automatically.
Activity
doc: cover #270, #277 and #289 and the deferred review findings in th…
doc: cover #270, #277 and #289 and the deferred review findings in th…
doc: cover #270, #277 and #289 and the deferred review findings in th…
wallet: fail descriptor key encryption when the plaintext record is n…
doc: cover #270, #277 and #289 and the deferred review findings in th…
doc: cover the PRs merged for v1.0.1 since the last notes update
release: prepare v1.0.1 (#181)
wallet: fail descriptor key encryption when the plaintext record is n…
release: prepare v1.0.1 (#181)
kiwidream commentedon Nov 12, 2026
Fixed on
1.x.xby #418 (e9f4499aba), which ships in v1.0.1:WalletBatch::WriteCryptedDescriptorKeynow returns the result of erasing the plaintext record, andDescriptorScriptPubKeyMan::Encryptfails when that call fails, so the failure goes throughEncryptWallet's abort path, as it already did for PQC keys. Test:wallet_encryption_tests/FailedKeyRecordWriteOrEraseFailsEncryption.Closing by hand, because a merge into
1.x.xdoes not close issues automatically.