aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/crypter.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-11-09 21:00:19 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-11-09 21:11:57 +0100
commite6e3fc39518b3e34d075f03fc087f8d0b7fa970a (patch)
treee0fe5171e1e5f4ea9859c19a5dbcd31137b50179 /src/wallet/crypter.h
parent1f4375f8e75f95522ad763d06da047b1b3893530 (diff)
parentdd9bb253c3a6be29dd2749ca34e4ec7eb6b593bb (diff)
Merge #11272: CKeystore/CCrypter: move relevant implementation out of the header
dd9bb25 Fix code style in keystore.cpp/crypter.cpp (Jonas Schnelli) 208fda6 CCrypter: move relevant implementation out of the header (Jonas Schnelli) 3155fd2 CKeystore: move relevant implementation out of the header (Jonas Schnelli) Pull request description: Tree-SHA512: 4ce73cca5609199b74b8ff2614ee2b6af949545a1332a3a0135c6453c98665d2b0da171c1e390c9a2aec6b12b7fad931ec90084bb7c2defe243786bfc70daf60
Diffstat (limited to 'src/wallet/crypter.h')
-rw-r--r--src/wallet/crypter.h44
1 files changed, 4 insertions, 40 deletions
diff --git a/src/wallet/crypter.h b/src/wallet/crypter.h
index 1416ae7d02..67c8481196 100644
--- a/src/wallet/crypter.h
+++ b/src/wallet/crypter.h
@@ -139,52 +139,16 @@ public:
{
}
- bool IsCrypted() const
- {
- return fUseCrypto;
- }
-
- bool IsLocked() const
- {
- if (!IsCrypted())
- return false;
- bool result;
- {
- LOCK(cs_KeyStore);
- result = vMasterKey.empty();
- }
- return result;
- }
-
+ bool IsCrypted() const { return fUseCrypto; }
+ bool IsLocked() const;
bool Lock();
virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;
- bool HaveKey(const CKeyID &address) const override
- {
- {
- LOCK(cs_KeyStore);
- if (!IsCrypted()) {
- return CBasicKeyStore::HaveKey(address);
- }
- return mapCryptedKeys.count(address) > 0;
- }
- return false;
- }
+ bool HaveKey(const CKeyID &address) const override;
bool GetKey(const CKeyID &address, CKey& keyOut) const override;
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;
- std::set<CKeyID> GetKeys() const override
- {
- LOCK(cs_KeyStore);
- if (!IsCrypted()) {
- return CBasicKeyStore::GetKeys();
- }
- std::set<CKeyID> set_address;
- for (const auto& mi : mapCryptedKeys) {
- set_address.insert(mi.first);
- }
- return set_address;
- }
+ std::set<CKeyID> GetKeys() const override;
/**
* Wallet status (encrypted, locked) changed.