| 233 | } |
| 234 | |
| 235 | bool CCryptoKeyStore::GetKey(const CKeyID &address, CKey& keyOut) const |
| 236 | { |
| 237 | { |
| 238 | LOCK(cs_KeyStore); |
| 239 | if (!IsCrypted()) |
| 240 | return CBasicKeyStore::GetKey(address, keyOut); |
| 241 | |
| 242 | CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address); |
| 243 | if (mi != mapCryptedKeys.end()) |
| 244 | { |
| 245 | const CPubKey &vchPubKey = (*mi).second.first; |
| 246 | const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second; |
| 247 | return DecryptKey(vMasterKey, vchCryptedSecret, vchPubKey, keyOut); |
| 248 | } |
| 249 | } |
| 250 | return false; |
| 251 | } |
| 252 | |
| 253 | bool CCryptoKeyStore::GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const |
| 254 | { |