X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwalletdb.cpp;h=ab85b072cfc680619ca5f05be15c5c1c5fcd4968;hb=34694c603fa90378d59d70804a5862df3845b2b8;hp=cd90f970783bed5db9c34ffbbe8467e1640f156a;hpb=48b27ec277c70795166bc1467c36bc7e1b335a11;p=novacoin.git diff --git a/src/walletdb.cpp b/src/walletdb.cpp index cd90f97..ab85b07 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -334,15 +334,14 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, } else if (strType == "key" || strType == "wkey") { - vector vchPubKey; - ssKey >> vchPubKey; CKey key; + CPubKey vchPubKey; + ssKey >> vchPubKey; if (strType == "key") { wss.nKeys++; CPrivKey pkey; ssValue >> pkey; - key.SetPubKey(vchPubKey); if (!key.SetPrivKey(pkey)) { strErr = "Error reading wallet database: CPrivKey corrupt"; @@ -353,6 +352,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, strErr = "Error reading wallet database: CPrivKey pubkey inconsistency"; return false; } + if (vchPubKey.size() == 33) { + key.SetCompressedPubKey(); + } if (!key.IsValid()) { strErr = "Error reading wallet database: invalid CPrivKey"; @@ -363,7 +365,6 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, { CWalletKey wkey; ssValue >> wkey; - key.SetPubKey(vchPubKey); if (!key.SetPrivKey(wkey.vchPrivKey)) { strErr = "Error reading wallet database: CPrivKey corrupt"; @@ -374,6 +375,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, strErr = "Error reading wallet database: CWalletKey pubkey inconsistency"; return false; } + if (vchPubKey.size() == 33) { + key.SetCompressedPubKey(); + } if (!key.IsValid()) { strErr = "Error reading wallet database: invalid CWalletKey"; @@ -405,7 +409,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, else if (strType == "ckey") { wss.nCKeys++; - vector vchPubKey; + CPubKey vchPubKey; ssKey >> vchPubKey; vector vchPrivKey; ssValue >> vchPrivKey;