Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/crypter.h
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | bool IsLocked() const { | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
bool Lock(); | bool Lock(); | ||||
virtual bool AddCryptedKey(const CPubKey &vchPubKey, | virtual bool AddCryptedKey(const CPubKey &vchPubKey, | ||||
const std::vector<uint8_t> &vchCryptedSecret); | const std::vector<uint8_t> &vchCryptedSecret); | ||||
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey); | bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) override; | ||||
bool HaveKey(const CKeyID &address) const { | bool HaveKey(const CKeyID &address) const override { | ||||
{ | |||||
LOCK(cs_KeyStore); | LOCK(cs_KeyStore); | ||||
if (!IsCrypted()) return CBasicKeyStore::HaveKey(address); | if (!IsCrypted()) { | ||||
return mapCryptedKeys.count(address) > 0; | return CBasicKeyStore::HaveKey(address); | ||||
} | } | ||||
return false; | |||||
return mapCryptedKeys.count(address) > 0; | |||||
} | } | ||||
bool GetKey(const CKeyID &address, CKey &keyOut) const; | bool GetKey(const CKeyID &address, CKey &keyOut) const override; | ||||
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const; | bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override; | ||||
void GetKeys(std::set<CKeyID> &setAddress) const { | void GetKeys(std::set<CKeyID> &setAddress) const override { | ||||
if (!IsCrypted()) { | if (!IsCrypted()) { | ||||
CBasicKeyStore::GetKeys(setAddress); | CBasicKeyStore::GetKeys(setAddress); | ||||
return; | return; | ||||
} | } | ||||
setAddress.clear(); | setAddress.clear(); | ||||
CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin(); | CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin(); | ||||
while (mi != mapCryptedKeys.end()) { | while (mi != mapCryptedKeys.end()) { | ||||
setAddress.insert((*mi).first); | setAddress.insert((*mi).first); | ||||
Show All 12 Lines |