X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fwalletdb.cpp;h=3880a93b7844e2ce64bdd858fa2618bc62bdaac3;hp=640f78b993dd2da355cdf4b8bc84325c1d5a587f;hb=27ce22da0815f4c1fa0e949cc4740e3f4dd1ea9c;hpb=1d40b6207e7d1591c47cce149aae84bb60dcc416 diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 640f78b..3880a93 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -85,7 +85,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list 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; @@ -525,7 +529,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) return DB_CORRUPT; } - while (true) + for ( ; ; ) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); @@ -625,7 +629,7 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash) return DB_CORRUPT; } - while (true) + for ( ; ; ) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); @@ -650,7 +654,7 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash) } pcursor->close(); } - catch (boost::thread_interrupted) { + catch (const boost::thread_interrupted&) { throw; } catch (...) {