mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 09:08:11 +00:00
CKeystore: move relevant implementation out of the header
This commit is contained in:
parent
52f8877525
commit
3155fd23f2
@ -36,6 +36,36 @@ bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CBasicKeyStore::HaveKey(const CKeyID &address) const
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
return mapKeys.count(address) > 0;
|
||||
}
|
||||
|
||||
std::set<CKeyID> CBasicKeyStore::GetKeys() const
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
std::set<CKeyID> set_address;
|
||||
for (const auto& mi : mapKeys) {
|
||||
set_address.insert(mi.first);
|
||||
}
|
||||
return set_address;
|
||||
}
|
||||
|
||||
bool CBasicKeyStore::GetKey(const CKeyID &address, CKey &keyOut) const
|
||||
{
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
KeyMap::const_iterator mi = mapKeys.find(address);
|
||||
if (mi != mapKeys.end())
|
||||
{
|
||||
keyOut = mi->second;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CBasicKeyStore::AddCScript(const CScript& redeemScript)
|
||||
{
|
||||
if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)
|
||||
|
@ -62,37 +62,9 @@ protected:
|
||||
public:
|
||||
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;
|
||||
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;
|
||||
bool HaveKey(const CKeyID &address) const override
|
||||
{
|
||||
bool result;
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
result = (mapKeys.count(address) > 0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
std::set<CKeyID> GetKeys() const override
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
std::set<CKeyID> set_address;
|
||||
for (const auto& mi : mapKeys) {
|
||||
set_address.insert(mi.first);
|
||||
}
|
||||
return set_address;
|
||||
}
|
||||
bool GetKey(const CKeyID &address, CKey &keyOut) const override
|
||||
{
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
KeyMap::const_iterator mi = mapKeys.find(address);
|
||||
if (mi != mapKeys.end())
|
||||
{
|
||||
keyOut = mi->second;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool HaveKey(const CKeyID &address) const override;
|
||||
std::set<CKeyID> GetKeys() const override;
|
||||
bool GetKey(const CKeyID &address, CKey &keyOut) const override;
|
||||
bool AddCScript(const CScript& redeemScript) override;
|
||||
bool HaveCScript(const CScriptID &hash) const override;
|
||||
bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;
|
||||
|
Loading…
Reference in New Issue
Block a user