if (!pcursor)
throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
unsigned int fFlags = DB_SET_RANGE;
- while (true)
+ for ( ; ; )
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
}
else if (strType == "key" || strType == "wkey")
{
- vector<unsigned char> 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";
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";
{
CWalletKey wkey;
ssValue >> wkey;
- key.SetPubKey(vchPubKey);
if (!key.SetPrivKey(wkey.vchPrivKey))
{
strErr = "Error reading wallet database: CPrivKey corrupt";
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";
else if (strType == "ckey")
{
wss.nCKeys++;
- vector<unsigned char> vchPubKey;
+ CPubKey vchPubKey;
ssKey >> vchPubKey;
vector<unsigned char> vchPrivKey;
ssValue >> vchPrivKey;
return DB_CORRUPT;
}
- while (true)
+ for ( ; ; )
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
return DB_CORRUPT;
}
- while (true)
+ for ( ; ; )
{
// Read next record
CDataStream ssKey(SER_DISK, CLIENT_VERSION);