Browse Source

Merge pull request #413 from TheBlueMatt/loadwalletret

Fix bad return values in LoadWallet.
0.8
Jeff Garzik 14 years ago
parent
commit
065d743019
  1. 6
      src/db.cpp

6
src/db.cpp

@ -777,7 +777,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
key.SetPrivKey(wkey.vchPrivKey); key.SetPrivKey(wkey.vchPrivKey);
} }
if (!pwallet->LoadKey(key)) if (!pwallet->LoadKey(key))
return false; return DB_CORRUPT;
} }
else if (strType == "mkey") else if (strType == "mkey")
{ {
@ -786,7 +786,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
CMasterKey kMasterKey; CMasterKey kMasterKey;
ssValue >> kMasterKey; ssValue >> kMasterKey;
if(pwallet->mapMasterKeys.count(nID) != 0) if(pwallet->mapMasterKeys.count(nID) != 0)
return false; return DB_CORRUPT;
pwallet->mapMasterKeys[nID] = kMasterKey; pwallet->mapMasterKeys[nID] = kMasterKey;
if (pwallet->nMasterKeyMaxID < nID) if (pwallet->nMasterKeyMaxID < nID)
pwallet->nMasterKeyMaxID = nID; pwallet->nMasterKeyMaxID = nID;
@ -798,7 +798,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
vector<unsigned char> vchPrivKey; vector<unsigned char> vchPrivKey;
ssValue >> vchPrivKey; ssValue >> vchPrivKey;
if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey))
return false; return DB_CORRUPT;
} }
else if (strType == "defaultkey") else if (strType == "defaultkey")
{ {

Loading…
Cancel
Save