After commit ccd85b57af60d7034db372b9501d059fbc5941e4 I can no longer open my wallet without warnings.

![Screenshot from 2020-05-22 10-45-35](https://user-images.githubusercontent.com/6399679/82679920-9704a180-9c19-11ea-8f55-4c935ced8fe2.png)

```
Warning: Error reading /home/marco/.bitcoin/regtest/wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.

break;
        }
        else if ((*it) == hash) {
            if(!EraseTx(hash)) {
                LogPrint(BCLog::WALLETDB, "Transaction was found for deletion but returned database error: %s\n", hash.GetHex());
                delerror = true;
            }
            vTxHashOut.push_back(hash);
        }
    }
    if (delerror) {
        return DBErrors::CORRUPT;
    }
    return DBErrors::LOAD_OK;
}
DBErrors WalletBatch::ZapWalletTx(std::list<CWalletTx>& vWtx)
{
    
    std::vector<uint256> vTxHash;
    DBErrors err = FindWalletTx(vTxHash, vWtx);
    if (err != DBErrors::LOAD_OK)
        return err;
    
    for (const uint256& hash : vTxHash) {
        if (!EraseTx(hash))
            return DBErrors::CORRUPT;
    }
    return DBErrors::LOAD_OK;
}
void MaybeCompactWalletDB()