Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Utmos on December 20, 2017, 01:37:35 PM



Title: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 01:37:35 PM
Something really terrible happened. I installed Bitcoin Core and Bitcoin ABC (Bitcoin Cash) and pointed them to different folders. But then by accident I pointed the Bitcoin shortcuts to Bitcoin Cash folder. I didn't even know and started using it because it didn't even warn me. Then there was a transaction problem which I tried to solve with -zapwallettxes command. Bitcoin Core started and showed 0 bitcoins. I panicked and closed it and then noticed the folders error. All this time Bitcoin Core has been using Bitcoin Cash folder, including the wallet.dat. Now I put the wallet.dat in Bitcoin folder and started Bitcoin Core and am waiting for synchronization now to see if the wallet it ok. But there is high probability that it will show me 0 bitcoins again. Please help! Do you think wallet.dat could get corrupt and if yes is there any way to fix it?


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: racquemis on December 20, 2017, 01:41:04 PM
Do you have your private key of your BTC and your BCC addresses?


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: ranochigo on December 20, 2017, 01:42:55 PM
If its corrupted, then the client will show it.

Zapwallettxes flag removes all the unconfirmed transactions and rescan the blockchain from the start. If you placed it into the Bitcoin Cash folder, then it would rescan using the BCH's blockchain. Just rescan using Bitcoin's blokchain and it should load perfectly. It shouldn't corrupt like this.


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 01:46:42 PM
The only thing I have is wallet.dat file, initially generated by Bitcoin Cash, then used by Bitcoin Core and then somehow modified by me supplying -zapwallettxes command to BitCoin Core.


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: racquemis on December 20, 2017, 01:48:32 PM
Ok so put the file back into the BCC folder (back it up first)
Now open Bitcoin ABC again and use -zapwallettxes again

That should do the trick to get your BCC working again


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 01:58:16 PM
I will try to explain again step by step.

Installed Bitcoin ABC, pointed to F:\BitcoinCash, it started and synchronized, there is big database and wallet.dat
Installed Bitcoin Core, pointed to F:\Bitcoin, it started and synchronized, there is big database and wallet.dat
Then I made a shortcut, "C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=f:\BitCoinCash\, which starts Bitcoin Core and makes it use BitcoinCash folder
I put money to Bitcoin Core launched like that, everything is ok
There is transaction problem, I do this:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=f:\BitCoinCash\ -zapwallettxes
Bitcoin Core starts, but shows 0 bitcoins (although it shouldn't)
Then I close it. Copy F:\BitcoinCash\wallet.dat to F:\Bitcoin\, correct the shorcut and start it:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=f:\BitCoinCash\
And right now I am waiting for sync and praying


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 02:09:18 PM
That should do the trick to get your BCC working again

So I have problem with BTC, not BCC :(


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: ranochigo on December 20, 2017, 02:21:52 PM
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=f:\BitCoinCash\ -zapwallettxes
Bitcoin Core starts, but shows 0 bitcoins (although it shouldn't)
Then I close it. Copy F:\BitcoinCash\wallet.dat to F:\Bitcoin\, correct the shorcut and start it:
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=f:\BitCoinCash\
And right now I am waiting for sync and praying
Did you have any confirmed balance inside before you ran the command? If it doesn't show that your wallet is corrupted, it probably isn't.


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 02:34:13 PM
Did you have any confirmed balance inside before you ran the command? If it doesn't show that your wallet is corrupted, it probably isn't.
Yes, I did and quite some. Why I think something is wrong is because Bitcoin Core showed me 0 balance when started with that command.


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: ranochigo on December 20, 2017, 02:45:46 PM
Did you have any confirmed balance inside before you ran the command? If it doesn't show that your wallet is corrupted, it probably isn't.
Yes, I did and quite some. Why I think something is wrong is because Bitcoin Core showed me 0 balance when started with that command.
Nothing is wrong and that's completely normal. Zapwallettxes removes all of your transactions and rescans the blockchain to find out all the confirmed transaction. As a result, your unconfirmed transactions are removed.


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 20, 2017, 02:48:01 PM
I hope you are right. Thank you. I will sleep a little better tonight ).


Title: Re: Wallet.dat could be corrupted by -zapwallettxes?
Post by: Utmos on December 21, 2017, 05:27:43 AM
Everything went OK. My bitcoins appeared. I am happy. It seems Bitcoin Core and Bitcoin ABC have completely compatible wallet.dat