wallet: Fix wallet interface detection of encrypted wallets #32620

pull achow101 wants to merge 3 commits into bitcoin:master from achow101:fix-gui-migrate-encrypted changing 6 files +54 −5
  1. achow101 commented at 10:06 pm on May 26, 2025: member

    The GUI uses WalletLoader::isEncrypted() to detect whether a wallet file is encrypted so that it knows whether to prompt for a passphrase when migrating a legacy wallet. However, legacy wallets need to be opened with options.require_format = BERKELEY_RO. Since this wasn’t being provided, following #28710, encrypted legacy wallets could not be migrated.

    This fixes the issue by detecting when a wallet file is for a legacy wallet, and re-attempting with options.require_format = BERKELEY_RO in that case.

    Depends on #32449 for DatabaseStatus::FAILED_LEGACY_DISABLED

  2. wallet: init, don't error out when loading legacy wallets
    Instead of failing during initialization when encountering a legacy wallet, skip
    loading the wallet and notify the user accordingly.
    
    This allows users to access migration functionalities without needing to manually
    remove the wallet from settings.json or resort to using the bitcoin-wallet utility.
    
    This means that GUI users will be able to use the migration button, and bitcoin-cli
    users will be able to call the migratewallet RPC directly after init.
    1a44c43adc
  3. test: verify node skips loading legacy wallets during startup 0b5ca71061
  4. wallet, interfaces: Use BERKELEY_RO in isEncrypted
    Since isEncrypted opens a file to search for a particular record, it
    needs to use BERKELEY_RO when opening a legacy wallet.
    267da51697
  5. DrahtBot commented at 10:06 pm on May 26, 2025: 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/32620.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  6. achow101 marked this as a draft on May 26, 2025
  7. DrahtBot added the label Wallet on May 26, 2025

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: 2025-05-30 00:13 UTC

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