ISTM that there is no implementation left of the RewriteDB method in any of the SPKMs, and thus, its call sites can be removed safely.
Also remove DBErrors::NEED_REWRITE enum value as its usage is outdated now.
RewriteDB calls from SPKM & DBErrors::NEED_REWRITE enum value
#34301
ISTM that there is no implementation left of the RewriteDB method in any of the SPKMs, and thus, its call sites can be removed safely.
Also remove DBErrors::NEED_REWRITE enum value as its usage is outdated now.
ISTM that there is no implementation left of the `RewriteDB` method
in any of the SPKMs, and thus, its call sites can be removed safely.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34301.
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | achow101 |
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Reviewers, this pull request conflicts with the following ones:
CWallet::Create() into CreateNew and LoadExisting by davidgumberg)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.
Concept ACK
I think this can actually extend a bit futher into getting rid of DBErrors::NEED_REWRITE entirely. This only exists for wallets created in 0.4.x which had the bug that the database was not rewritten. However, given that BDB is no longer supported at all and migration is explicitly a rewrite anyways, there’s actually no situation in which NEED_REWRITE being returned is ever doing anything useful.
The only places we should ever need WalletDatabase::Rewrite are in wallet encryption.
As highlighted in the PR review comment, this enum seems no longer
required as the specific issue it solves for involves BDB based wallets
that can't be loaded anymore outside the context of wallet migration,
which rewrites the database anyway.
I think this can actually extend a bit futher into getting rid of DBErrors::NEED_REWRITE entirely.
Thanks, I have added a commit addressing this point.