Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Shevek on July 21, 2011, 09:47:26 AM



Title: wallet.dat lost and recovered, but balance flew away!
Post by: Shevek on July 21, 2011, 09:47:26 AM
I've search for this problem a bit, but I had bad luck  :( despite of this, I'm sure it stands somewhere. So, sorry if I repeat the topic.

Yesterday I accidentally wipe off the file 'wallet.dat'. No problem: I took my backup and restored it. My backup was a bit old, so when I restarted bitcoin, the addresses stay but the balance, with all operations made after backup, blew up. The reason is, because bitcoin uses the same file, 'wallet.dat' to keep private keys, public keys and transactions.

The only solution I've found for restoring the balance was restart bitcoin in a new folder (conserving 'wallet.dat' and 'bitcoin.conf') and wait several hours for the block-data rebuild up.

So the question is: is there any more clever way to restore the balance!? The information about transactions is in the block chain, available to the program; I think the client program should have an option "rescan the blockchain" or similar for such occasions. And, even better, keep the transaction file away from priv. keys!


Title: Re: wallet.dat lost and recovered, but balance flew away!
Post by: Meni Rosenfeld on July 21, 2011, 09:50:01 AM
Use the -rescan (https://en.bitcoin.it/wiki/Running_Bitcoin) command line argument. (If you're using a shortcut in Windows it can be added to it).

And you do know that your backups need to be relatively recent, and that an old backup might not have any of your coins, right?


Title: Re: wallet.dat lost and recovered, but balance flew away!
Post by: Shevek on July 21, 2011, 11:08:57 AM
Use the -rescan (https://en.bitcoin.it/wiki/Running_Bitcoin) command line argument.

Thanks Meni! I oversaw this option!

And you do know that your backups need to be relatively recent, and that and old backup might not have any of your coins, right?

I know this even before wipe the file. I simply think that rescanning is done by default...


Title: Re: wallet.dat lost and recovered, but balance flew away!
Post by: Meni Rosenfeld on July 21, 2011, 11:19:09 AM
And you do know that your backups need to be relatively recent, and that and old backup might not have any of your coins, right?
I know this even before wipe the file.
Ok, I was just concerned because you said "My backup was a bit old".

I simply think that rescanning is done by default...
Rescanning takes time, so shouldn't be done unless necessary. I guess future clients will intelligently determine when it is necessary.