<p>I started <code>Bitcoin Core 0.20.0</code> and allowed it to sync with the network.</p>

<p>The synchronization was completed. However my balance is 0.00 and all transaction history is missing.</p>

<p>I tried to troubleshoot the problem. One at a time, I loaded the two wallet files (wallet.dat and default-wallet.dat) through bitcoind and checked the output.</p>

<p>Both these files were backuped from the last time I used Bitcoin in 2015.</p>

<p>Command:</p>

<pre><code>bitcoind.exe -rescan -upgradewallet -upnp=1 -wallet=wallet.dat -datadir=.\..\BitcoinData
</code></pre>

<p>This line got me worried:</p>

<pre><code>2020-06-10T20:19:03Z [wallet.dat] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0    
</code></pre>

<p>Both wallets show this line. </p>

<p>Output pertaining to the wallet</p>

<pre><code>2020-06-10T20:19:03Z [wallet.dat] Wallet File Version = 10500
2020-06-10T20:19:03Z [wallet.dat] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2020-06-10T20:19:03Z [wallet.dat] Performing wallet upgrade to 169900
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 0 does not exist
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 1 does not exist
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 2 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 0 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 1 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 2 does not exist
2020-06-10T20:19:12Z [wallet.dat] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2020-06-10T20:19:12Z [wallet.dat] LegacyScriptPubKeyMan::NewKeyPool rewrote keypool
2020-06-10T20:19:12Z [wallet.dat] Wallet completed loading in           10400ms
2020-06-10T20:19:12Z init message: Rescanning...
2020-06-10T20:19:12Z [wallet.dat] Rescanning last 634090 blocks (from block 0)...
2020-06-10T20:19:12Z [wallet.dat] Rescan started from block 0000000000000000000d972cc312510d2a4811854e3705a0693289d73065af75...
2020-06-10T20:19:13Z [wallet.dat] Rescan completed in             163ms
2020-06-10T20:19:13Z [wallet.dat] setKeyPool.size() = 2000
2020-06-10T20:19:13Z [wallet.dat] mapWallet.size() = 0
2020-06-10T20:19:13Z [wallet.dat] m_address_book.size() = 0
</code></pre>

<p>Should I assume the wallet keys are lost, or maybe this was a upgrade issue with the wallet. What should I try next?</p>

<p>Thank you.</p>

CC BY-SA 4.0
2020-06-10T21:35:05.873Z
It's probably an issue with paths. In the log before these lines, you should see a line beginning with `BerkeleyEnvironment::Open`. Odes the `LogDir` in the line have something like `<datadir>/dattabase` or `<datadir>/wallets/database` where `<datadir>` is the absolute path to your datadir?
Ava Chow
CC BY-SA 4.0
2020-06-10T21:35:53.563Z
Alternatively, instead of having the wallet files just in the datadir, put them inside folders with different names and do `-wallet=<name of folder>`. Make sure the wallet files are named `wallet.dat` within those folders.
Ava Chow
CC BY-SA 4.0
2020-06-11T01:46:51.353Z
@AndrewChow Having the `.dat` files outside the datadir was the issue. I placed them back there, now I see bitcoind has found the keys and is rescanning. I probably should have used walletdir to specify where I was storing the wallet files, instead of just issuing the command from the folder where they are in, and expect `wallet=` to do my bidding. Your hint was on track. Thank you.
Fábio Antunes
<bitcoin-core><bitcoind><wallet>
Wallet files are empty
Fábio Antunes
# Wallet files are empty

(Asked by: username_0 on 2020-06-10)

I started Bitcoin Core 0.20.0 and allowed it to sync with the network.
The synchronization was completed. However my balance is 0.00 and all transaction history is missing.
I tried to troubleshoot the problem. One at a time, I loaded the two wallet files (wallet.dat and default-wallet.dat) through bitcoind and checked the output.
Both these files were backuped from the last time I used Bitcoin in 2015.
Command:
bitcoind.exe -rescan -upgradewallet -upnp=1 -wallet=wallet.dat -datadir=.\..\BitcoinData

This line got me worried:
2020-06-10T20:19:03Z [wallet.dat] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0    

Both wallets show this line. 
Output pertaining to the wallet
2020-06-10T20:19:03Z [wallet.dat] Wallet File Version = 10500
2020-06-10T20:19:03Z [wallet.dat] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
2020-06-10T20:19:03Z [wallet.dat] Performing wallet upgrade to 169900
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 0 does not exist
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 1 does not exist
2020-06-10T20:19:04Z [wallet.dat] External scriptPubKey Manager for output type 2 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 0 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 1 does not exist
2020-06-10T20:19:04Z [wallet.dat] Internal scriptPubKey Manager for output type 2 does not exist
2020-06-10T20:19:12Z [wallet.dat] keypool added 2000 keys (1000 internal), size=2000 (1000 internal)
2020-06-10T20:19:12Z [wallet.dat] LegacyScriptPubKeyMan::NewKeyPool rewrote keypool
2020-06-10T20:19:12Z [wallet.dat] Wallet completed loading in           10400ms
2020-06-10T20:19:12Z init message: Rescanning...
2020-06-10T20:19:12Z [wallet.dat] Rescanning last 634090 blocks (from block 0)...
2020-06-10T20:19:12Z [wallet.dat] Rescan started from block 0000000000000000000d972cc312510d2a4811854e3705a0693289d73065af75...
2020-06-10T20:19:13Z [wallet.dat] Rescan completed in             163ms
2020-06-10T20:19:13Z [wallet.dat] setKeyPool.size() = 2000
2020-06-10T20:19:13Z [wallet.dat] mapWallet.size() = 0
2020-06-10T20:19:13Z [wallet.dat] m_address_book.size() = 0

Should I assume the wallet keys are lost, or maybe this was a upgrade issue with the wallet. What should I try next?
Thank you.

**Tags:** bitcoin-core, bitcoind, wallet

> **Comments:**
> **username_1**: It's probably an issue with paths. In the log before these lines, you should see a line beginning with `BerkeleyEnvironment::Open`. Odes the `LogDir` in the line have something like `<datadir>/dattabase` or `<datadir>/wallets/database` where `<datadir>` is the absolute path to your datadir?  
> **username_1**: Alternatively, instead of having the wallet files just in the datadir, put them inside folders with different names and do `-wallet=<name of folder>`. Make sure the wallet files are named `wallet.dat` within those folders.  
> **username_0**: @AndrewChow Having the `.dat` files outside the datadir was the issue. I placed them back there, now I see bitcoind has found the keys and is rescanning. I probably should have used walletdir to specify where I was storing the wallet files, instead of just issuing the command from the folder where they are in, and expect `wallet=` to do my bidding. Your hint was on track. Thank you.  

---

## 0 answers

