Bugfixes walletclass

Some problems found by ius:
* compiler complains with no return after critical section block
* CKeyStore::GetPrivKey(key) was undefined for unknown key
* missing return statement in GetChange()
This commit is contained in:
Pieter Wuille
2011-06-19 18:32:36 +02:00
parent 04e442070d
commit 98705aa51c
4 changed files with 14 additions and 8 deletions

View File

@@ -14,11 +14,15 @@ public:
{
return (mapKeys.count(vchPubKey) > 0);
}
CPrivKey GetPrivKey(const std::vector<unsigned char> &vchPubKey) const
bool GetPrivKey(const std::vector<unsigned char> &vchPubKey, CPrivKey& keyOut) const
{
std::map<std::vector<unsigned char>, CPrivKey>::const_iterator mi = mapKeys.find(vchPubKey);
if (mi != mapKeys.end())
return (*mi).second;
{
keyOut = (*mi).second;
return true;
}
return false;
}
std::vector<unsigned char> GenerateNewKey();
};