bitcoin / bitcoin

Bitcoin Core integration/staging tree
https://bitcoincore.org/en/download
MIT License
77.31k stars 35.65k forks source link

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

Open kristapsk opened 5 years ago

kristapsk commented 5 years ago

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.

maflcko commented 5 years ago

Loosely related:

promag commented 5 years ago

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

nikitasius commented 5 years ago

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

upd: i use console 0.18.0, official, debian.

hg333 commented 2 years ago

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

hebasto commented 2 years ago

@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?

fanquake commented 2 weeks ago

Is this fixed after #18554?

maflcko commented 2 weeks ago

Is this fixed after https://github.com/bitcoin/bitcoin/pull/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?