utils: wallet_dump can create a database
directory, cross-pollinating records
#29883
Open
1 task done
Labels
Is there an existing issue for this?
Current behaviour
I created a large directory with legacy wallet dat files for testing #26606. Ran into a weird issue where the output mismatches, but after investigating deeper, this was not due to a bug in that PR.
So I created a script that iterates over all wallets, dumps them with the internal bdb and external bdb, diffs the textual output, stopping on the first wallet which mismatches. Mind that the wallets are loose
.dat
files, not themselves subdirectories.So far so good.
However, I was seeing some huge divergences. Not small differences that could be explained to differences in interpretation, but e.g. the output would have wildly different
blockheight
. A kind of cross-pollination.What it turned out to be is that the
bitcoin-wallet dump
leaves behind adatabase/
subdirectory on close containing log files (log.0000000001
etc). When opening the next wallet in the same directory, this subdirectory is used, and affects the dumped contents of the new wallet.Deleting the
database
directory between wallets solves the problem. If this is still worth fixing, the wallet should probably compact after close to incorporate the log files. You wouldn't expect modification on a read-only operation in the first place, but I suppose this is due to an inherent bdb limitation.Expected behaviour
Successively dumped wallets don't affect each other.
Steps to reproduce
See script in "current behavior".
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
7f8d4c9 (#26606)
Operating system and version
Ubuntu 24.04
Machine specifications
No response
The text was updated successfully, but these errors were encountered: