aboutsummaryrefslogtreecommitdiff
path: root/src/keystore.h
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2011-06-19 18:32:36 +0200
committerPieter Wuille <[email protected]>2011-06-20 20:07:28 +0200
commit98705aa51cbfee81ecd2498a014c285ac677ba69 (patch)
treedcd42eff69a50111b29f7bdb7cad396dd49c6b7b /src/keystore.h
parentMerge pull request #332 from shanew/master (diff)
downloaddiscoin-98705aa51cbfee81ecd2498a014c285ac677ba69.tar.xz
discoin-98705aa51cbfee81ecd2498a014c285ac677ba69.zip
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()
Diffstat (limited to 'src/keystore.h')
-rw-r--r--src/keystore.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/keystore.h b/src/keystore.h
index 3b6869b42..6080d7d7f 100644
--- a/src/keystore.h
+++ b/src/keystore.h
@@ -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();
};