Bitcoin Core on mainnet shows testnet3 dir as a wallet to open and allows opening it #16107

issue kristapsk opened this issue on May 27, 2019
  1. kristapsk commented at 8:26 PM on May 27, 2019: contributor

    If you use both mainnet and testnet3 on the same machine, in default configuration testnet3 directory is under mainnet Bitcoin datadir. If you have also testnet wallet there (testnet3/wallet.dat file), it will show testnet3 directory in bitcoin-cli listwalletdir and "File > Open Wallet" list in GUI and actually allow to open it in mainnet. Don't think this is the expected behaviour.

  2. fanquake added the label GUI on May 27, 2019
  3. fanquake added the label Wallet on May 27, 2019
  4. maflcko commented at 10:06 PM on May 27, 2019: member

    Loosely related:

    • Wallet file should not be reused across chains #12805
  5. promag commented at 10:33 PM on May 29, 2019: contributor

    Maybe a quick fix is to blacklist these "internal" paths?

  6. fanquake removed the label GUI on May 29, 2019
  7. nikitasius commented at 3:13 PM on June 5, 2019: none

    after syncing from zero i got folder wallets in my testnet3 folder while in config i had:

    • walletdir=/path/to/my/testnet/wallet/folder/

    upd: i use console 0.18.0, official, debian.

  8. hg333 commented at 5:08 AM on August 22, 2021: contributor

    After creating a wallet in testne3, I was able to load the wallet in mainnet(https://github.com/bitcoin/bitcoin/issues/12805), but the ./bitcoin-cli listwalletdir didn't show any of the testnet3 wallets.

    Using version 22.0rc1, on Ubuntu 20.04

  9. hebasto commented at 3:31 PM on October 8, 2021: member

    @kristapsk

    If you use both mainnet and testnet3 on the same machine, in default configuration testnet3 directory is under mainnet Bitcoin datadir. If you have also testnet wallet there (testnet3/wallet.dat file), it will show testnet3 directory in bitcoin-cli listwalletdir and "File > Open Wallet" list in GUI and actually allow to open it in mainnet. Don't think this is the expected behaviour.

    I assume I don't have/use wallets subdirectories that were introduced in #11466 (since v0.16.0). What if you move your wallets into the dedicated directories?

  10. fanquake commented at 9:06 AM on July 4, 2024: member

    Is this fixed after #18554?

  11. maflcko commented at 10:30 AM on July 4, 2024: member

    Is this fixed after #18554?

    The "allows opening" part should be fixed by this. Not sure about the listing part.

    However, if it wasn't fixed by now, my understanding is that this will also be fixed by migrating the BDB wallets to sqlite wallets, because they are placed in dedicated folders, and they can not exists as standalone files?

  12. maflcko commented at 9:27 AM on May 6, 2025: member

    For reference, BDB removal #31250 was merged (for 30.0)

    Is this still an issue with a recent version of Bitcoin Core? If yes, what are the steps to reproduce?

  13. maflcko closed this on May 6, 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: 2026-04-21 15:14 UTC

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