| 991 | } |
| 992 | |
| 993 | bool LegacyScriptPubKeyMan::GetKey(const CKeyID &address, CKey& keyOut) const |
| 994 | { |
| 995 | LOCK(cs_KeyStore); |
| 996 | if (!m_storage.HasEncryptionKeys()) { |
| 997 | return FillableSigningProvider::GetKey(address, keyOut); |
| 998 | } |
| 999 | |
| 1000 | CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address); |
| 1001 | if (mi != mapCryptedKeys.end()) |
| 1002 | { |
| 1003 | const CPubKey &vchPubKey = (*mi).second.first; |
| 1004 | const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second; |
| 1005 | return DecryptKey(m_storage.GetEncryptionKey(), vchCryptedSecret, vchPubKey, keyOut); |
| 1006 | } |
| 1007 | return false; |
| 1008 | } |
| 1009 | |
| 1010 | bool LegacyScriptPubKeyMan::GetKeyOrigin(const CKeyID& keyID, KeyOriginInfo& info) const |
| 1011 | { |