2

Questions:

  1. Should it be assumed if you're testing with bitcoincore you should always have a separate datadir per version/bin?
  2. Based on weirdness below, (not being able to list regtest wallets), does it seem like my current node is messed up? If yes, what should I do to recover? If no, what am I doing wrong?

Details:

I was running version v25.0 of bitcoincore from bitcoincore.org. I crated some wallets and did some testing. I then compiled from master/source bitcoin/bitcoin and pointed to the same backend state/datadir that v25.0 was using. Later I switched back to running the binary v25.0.

I'm curious if that could be the reason for seeing weird things like this or if it's something else:

$ ./bitcoin-cli createwallet wallet_main
error code: -4
error message:
Wallet file verification failed. Failed to create database path '/btcdata/regtest/wallets/wallet_main'. Database already exists.

$ ./bitcoin-cli listwallets
[
]

$ ./bitcoin-cli createwallet wallet_main33
{
  "name": "wallet_main33"
}

$ ./bitcoin-cli listwallets
[
  "wallet_main33"
]

$ ./bitcoin-cli createwallet wallet_main
error code: -4
error message:
Wallet file verification failed. Failed to create database path '/btcdata/regtest/wallets/wallet_main'. Database already exists.

I was doing some testing on regtest a few days ago and created several wallets including a "wallet_main", it seems there is still some data of this and other regtest wallets, but they don't show up with the listwallets command.

Am I doing something wrong to list the all the wallets? Is it maybe a bug? or did I perhaps mess up my node?

Additional notes: Inside my /btcdata/regtest/wallets/ directory all my wallets look the same in term user/permissions the folder for the wallet names are 700, drwx------, and the inner wallet.dat's are 600, -rw-------. I indeed have a /btcdata/regtest/wallets/wallet_main dir.

3
  • When you're using regtest (or testnet or signet) you're supposed to add -regtest to the bitcoin-cli command, so it can find the right data directory and config file sections. I'm surprised anything works at all without that. Jun 11 at 22:15
  • 1
    To actually answer your question: you may need to issue loadwallet RPC to load existing wallets, if they're not set to auto loading. If that resolves it, I'll turn this into an answer. Jun 11 at 22:19
  • Yes, brain fart.. loadwallet is what I need to do. I also see there is detailed explanation within bitcoin.conf to help people autoload various wallets. Also, bitcoin.conf set to run regtest via chain=regtest so I don't need to put -regtest it in every command. (I believe this is how it works?) Also doing this in bitcoin.conf: ``` # Options for regtest [regtest] # Options for regtest [regtest] rpcport=8332 fallbackfee=0.01 ``` You're good to turn your comment into an answer! Jun 11 at 22:38

1 Answer 1

2

The listwallets RPC only lists loaded wallets.

If you want to load an existing wallet, you need the loadwallet RPC first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.