Repository navigation
Description
Summary
When the pending rewrite fails, every RPC and GUI backup is refused, with no documented fallback.
Severity: low. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against the open PR's head; area: #300.
Observed
Confidence: confirmed (code path); the trigger is uncommon.
- Location:
src/wallet/wallet.cpp:4692-4706(CWallet::BackupWallet) and:4324-4335(load-time retry inCWallet::Create) ate8f07a5701. - Scenario:
- v1.0.1 loads a wallet encrypted by v1.0.0. It has no
postencryptionrewriterecord, soNeedsRewriteAfterEncryption()is true. - The one-time VACUUM fails. Known triggers: free space below about 2× the file size in the datadir plus a temporary copy in SQLite's temp directory (
$SQLITE_TMPDIR,$TMPDIR, then/var/tmp); or an unfinished read statement. - The load continues with
PendingRewriteWarning(). - Every
backupwalletcall and GUI backup then retries the VACUUM, fails again and returnsBackup refused: …. This lasts until a rewrite succeeds. - Most v1.0.0-encrypted wallets were already vacuumed by v1.0.0's own post-derivation
Rewrite(). Only an interrupted or failed v1.0.0 encryption leaves plaintext keys in free space. The record cannot tell the two cases apart, so clean wallets are refused too.
- v1.0.1 loads a wallet encrypted by v1.0.0. It has no
- Evidence: traced from code.
BackupWalletreturnsutil::ErrorbeforeGetDatabase().Backup()whenRewriteAfterEncryption()fails.Createonly warns.SQLiteDatabase::Rewrite()(src/wallet/sqlite.cpp:339-364) returns false on any VACUUM error. The depends SQLite build (depends/packages/sqlite.mk) uses the default file-backed temp store. Not reproduced.
Impact
A funded wallet cannot be backed up through the supported interfaces, and this happens in exactly the low-disk situation where operators most want a backup (wallet data safety). The refusal is intentional. But neither the release note (doc/release-notes-285.md) nor the error text tells the user how to get a safe copy in the meantime.
Suggested fix
Add a fallback that does not copy free pages to release-notes-285 and to the refusal message: unload the wallet and run qbit-wallet -wallet=<name> dump, then createfromdump (or free disk space and reload). Optionally add an explicit override to backupwallet for operators who accept the risk.
Related: new. The PR body describes the refusal as intended; the missing fallback is not mentioned.
Activity
wallet: point a refused backup to qbit-wallet's dump
wallet: point a refused backup to qbit-wallet's dump
wallet: point a refused backup to qbit-wallet's dump
wallet: remove deleted plaintext keys from the wallet file after encr…
kiwidream commentedon Nov 11, 2026
Fixed on
1.x.xby #300 (ea571b86f5), which ships in v1.0.1: a backup refused because the pending rewrite keeps failing now names theqbit-wallet ... dump/createfromdumproute, in the error message, in thebackupwallethelp and in the release note. No override that copies free space was added.Closing by hand, because a merge into
1.x.xdoes not close issues automatically.wallet: remove deleted plaintext keys from the wallet file after encr…