This article is deprecated and has been replaced with the following articles:
An abnormal exit of the wallet could result in a blockchain inconsistency from that point onwards. This can happen due to a PC reboot without first closing the wallet gracefully or if the existing locally downloaded blockchain somehow got corrupt (due to environmental issues etc) and cause the wallet to crash.
If experiencing wallet launch failures with the latest wallet, it is suggested to first try using the -forcestart startup flag to see if it will recover from a failed start.
In Windows OS, you need to edit the shortcut properties and append it to the end of the "Target" field, so that the end reads:
If the wallet startup issue is not fixed by upgrading to v18.104.22.168 or higher and/or the -forcestart flag, the user should resync the blockchain as per steps below.
As you are not deleting the conf and wallet.dat file, this procedure will not affect your coins nor your masternodes.
GUI Wallet users:
"Tools > Wallet Repair > Delete Local Blockchain Folders (-resync)" to initiate the full re-sync.
(unless you have a known good backup of the blockchain that you know how to restore)
Command line users:
You can initiate the full resync during daemon startup with the command switch `pivxd -resync`
1) Navigate to your PIVX data directory and delete the files pointed in red arrow in the following image:
You must also delete the folders called: zerocoin & sporks if you are following this guide
2) Now re-launch the wallet and wait for it to Sync. This can take few hours on slower internet connection.
**Please note that during the sync your balance will show as 0 until near the end, this is normal and nothing is lost**
It is recommended that after a successful full resync, you make a backup of your blockchain as this "good" blockchain snapshot could come handy later. You'll be able to use it to avoid a full resync if your chain gets corrupt again. To make a backup of the good blockchain, follow the steps outlined in the following KB article:
Now, if you face a corrupt blockchain again, just delete the 4 folders blocks, chainstate, sporks, & zerocoin only, copy over the good backup blocks, chainstate, sporks, & zerocoin folders, then restart the wallet and you will only have to sync transactions since the backup, not the beginning of PIVX.