# How To Fix Various Problems

This document will document how to recover and fix various issues that users may run into.

## Database corruption

The problem: You see an error like

```
EXCEPTION: 15dbwrapper_error
Database corrupted
```

This means your blockchain data on disk is corrupted. This is not the same as wallet corruption.
The fix to this is to do a fresh sync using the same wallet.dat file. You need to find
where this data lives on your computer and then move some files around, then restart the wallet.

### On Linux

If you are on Linux, your wallet lives at `~/.hush/DRAGONX/wallet.dat`.

What we will do is backup your entire `DRAGONX` directory, including the blockchain data and wallet,
then copy the wallet from there into a new directory. This is a non-destructive process that creates
a new backup of your wallet.

```
# Make sure your node is not running before doing any of this!
# Doing this while your node is running could corrupt your wallet.dat
cd ~/.hush
mv DRAGONX DRAGONX-backup                          # backup all data
mkdir DRAGONX                                      # make a new dir
cp DRAGONX-backup/wallet.dat DRAGONX/wallet.dat    # copy old wallet to new dir
```

At this point restart your node (`dragonxd`) and it will perform a fresh sync using your
wallet. This will likely take at least a few hours or much longer depending on your
internet connection.

### On Windows

Basically you want to find where your DragonX wallet is, move the directory that contains
that wallet.dat file to a new name, then create that same directory and then copy wallet.dat into it.
Different versions of Windows store things in different locations. Note the app-data folder is
named `Hush` (inherited) with a `DRAGONX` subdirectory.

For example your wallet might be in `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX\wallet.dat` .
That means you need to

    * Rename the directory `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX` to something like `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX-backup`
    * Create a new directory called `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX`
    * Copy the file `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX-backup\wallet.dat` to `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX`
    * Now start your DragonX node again
