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.

if (wss.m_hd_chains.size() > 0) {
        LegacyScriptPubKeyMan* legacy_spkm = pwallet->GetLegacyScriptPubKeyMan();
        if (!legacy_spkm) {
            pwallet->WalletLogPrintf("Inactive HD Chains found but no Legacy ScriptPubKeyMan\n");
            return DBErrors::CORRUPT;
        }
        for (const auto& chain_pair : wss.m_hd_chains) {
            if (chain_pair.first != pwallet->GetLegacyScriptPubKeyMan()->GetHDChain().seed_id) {
                pwallet->GetLegacyScriptPubKeyMan()->AddInactiveHDChain(chain_pair.second);
            }
        }
    }
    return result;
}
DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWalletTx>& vWtx)
{
    DBErrors result = DBErrors::LOAD_OK;
    try {
        int nMinVersion = 0;
        if (m_batch.Read(DBKeys::MINVERSION, nMinVersion)) {
            if (nMinVersion > FEATURE_LATEST)
                return DBErrors::TOO_NEW;
        }
        
        Dbc* pcursor = m_batch.GetCursor();
        if (!pcursor)
        {
            LogPrintf("Error getting wallet database cursor\n");
            return DBErrors::CORRUPT;
        }