wallet: remove outdated RewriteDB calls from SPKM & DBErrors::NEED_REWRITE enum value #34301

pull rkrux wants to merge 2 commits into bitcoin:master from rkrux:rewritedb changing 5 files +1 −27
  1. rkrux commented at 10:11 am on January 15, 2026: contributor

    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.

  2. wallet: remove unimplemented `RewriteDB` calls from SPKM
    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.
    1bba09f47e
  3. DrahtBot added the label Wallet on Jan 15, 2026
  4. DrahtBot commented at 10:11 am on January 15, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34301.

    Reviews

    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.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32636 (Split 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.

  5. achow101 commented at 9:09 pm on January 15, 2026: member

    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.

  6. wallet: remove `DBErrors::NEED_REWRITE` enum value
    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.
    5c802c73c0
  7. rkrux renamed this:
    wallet: remove unimplemented `RewriteDB` calls from SPKM
    wallet: remove outdated `RewriteDB` calls from SPKM & `DBErrors::NEED_REWRITE` enum value
    on Jan 16, 2026
  8. rkrux commented at 11:02 am on January 16, 2026: contributor

    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.

  9. achow101 commented at 9:01 pm on January 19, 2026: member
    ACK 5c802c73c0d40cf327bbe3333853b9ebfb5b7563

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-22 09:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me