0

I think I've lost some testnet coins in my Core wallet and I'm not sure how. I do bitcoin-cli -testnet listwallets and it doesn't show any wallets for me to load. But I definitely had testnet coins a number of weeks ago in the Core wallet and I haven't deleted or edited the wallet.dat file manually.

  1. Apart from looking in my wallet.dat file is there anything I should do?

  2. I try to open my wallet.dat file using sqlite3 wallet.dat and then .dump but this returns an error code saying wallet.dat is not a database. What am I doing wrong here? How do I dump the contents of the wallet.dat file?

10
  • 2
    Might this wallet.dat be a pre-descriptors BDB wallet file? Only descriptors wallets use sqlite. What does getwalletinfo say? Aug 22 at 18:16
  • @PieterWuille: Possibly... I have BDB installed and hence legacy wallet support should be built too. How do I do a listwallets for legacy/descriptors=false? I'm looking around github.com/bitcoin/bitcoin/issues/20160 but I haven't found instructions yet Aug 22 at 18:41
  • getwalletinfo says No wallet is loaded Aug 22 at 18:48
  • What does file say on the wallet.dat file? Aug 22 at 18:59
  • 1
    Just look in $DATADIR/testnet3/wallets. I think there is a listwalletdir command too. If the wallet is elsewhere, you'll need to remember where you put the file... Aug 22 at 20:26

1 Answer 1

0

With help from Pieter above (in the comments) I located my testnet coins.

The CLI command listwalletdir should return the available wallet names (also located in $DATADIR/testnet3/wallets) but I'm pretty sure this didn't work for me initially.

You can't use the CLI command listwallets though as this only lists wallets that have been loaded. If a wallet exists but hasn't been loaded it won't be listed in the output of listwallets.

If you know the name of the wallet (located in $DATADIR/testnet3/wallets) you can run bitcoin-cli loadwallet insert_wallet_name and then the wallet should show up in the output of bitcoin-cli listwallets.

I try to open my wallet.dat file using sqlite3 wallet.dat and then .dump but this returns an error code saying wallet.dat is not a database. What am I doing wrong here? How do I dump the contents of the wallet.dat file?

My wallet.dat file was a legacy BerkeleyDB Core wallet (can check with file wallet.dat) rather than a non-legacy SQLite Core wallet so obviously couldn't be viewed using sqlite3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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