mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
wallet: Clear streams before advancing BDB cursor #36871
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!36871
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bdb-cursor-stream-reset"
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?
This fixes a case where migratewallet can reject an old wallet as corrupt, i.e. this occurs on wallets used in Bitcoin Knots. The v2 key metadata may include an extra flag byte that Core’s metadata loader leaves unread.
LoadRecords reuses its key and value streams between records. BerkeleyROCursor::Next() appends to those streams, so unread bytes from one record become part of the next and can cause a deserialization error.
Clear both streams before copying the next record, matching SQLiteCursor::Next(). This keeps the existing metadata parsing and migration code.
The regression test reads two records while leaving part of the first key and value unread, then checks that the second record replaces both outputs.
Testing on Linux:
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.
Conflicts
Reviewers, this pull request conflicts with the following ones:
-Wunusedby fanquake)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · Cursor regression omits legacy metadata suffix acceptance
The cursor test catches appending but does not protect the legacy loader's acceptance of suffixed metadata; which released software wrote the reported version-2 suffix remains unverified.
Location:
src/wallet/test/db_tests.cpp:64(head).Review coverage was incomplete.
Reviewed:
00bb61e694cf· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.