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.

int64_t nIndex;
            ssKey >> nIndex;
            CKeyPool keypool;
            ssValue >> keypool;
            pwallet->GetOrCreateLegacyScriptPubKeyMan()->LoadKeyPool(nIndex, keypool);
        } else if (strType == DBKeys::CSCRIPT) {
            uint160 hash;
            ssKey >> hash;
            CScript script;
            ssValue >> script;
            if (!pwallet->GetOrCreateLegacyScriptPubKeyMan()->LoadCScript(script))
            {
                strErr = "Error reading wallet database: LegacyScriptPubKeyMan::LoadCScript failed";
                return false;
            }
        } else if (strType == DBKeys::ORDERPOSNEXT) {
            ssValue >> pwallet->nOrderPosNext;
        } else if (strType == DBKeys::DESTDATA) {
            std::string strAddress, strKey, strValue;
            ssKey >> strAddress;
            ssKey >> strKey;
            ssValue >> strValue;
            pwallet->LoadDestData(DecodeDestination(strAddress), strKey, strValue);
        } else if (strType == DBKeys::HDCHAIN) {
            CHDChain chain;
            ssValue >> chain;
            pwallet->GetOrCreateLegacyScriptPubKeyMan()->SetHDChain(chain, true);
        } else if (strType == DBKeys::FLAGS) {
            uint64_t flags;
            ssValue >> flags;