Bitcoin Core  0.18.99
P2P Digital Currency
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CBasicKeyStore Class Reference

Basic key store, that keeps keys in an address->secret map. More...

#include <keystore.h>

Inheritance diagram for CBasicKeyStore:
[legend]
Collaboration diagram for CBasicKeyStore:
[legend]

Public Member Functions

bool AddKeyPubKey (const CKey &key, const CPubKey &pubkey) override
 Add a key to the store. More...
 
bool AddKey (const CKey &key)
 
bool GetPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const override
 
bool HaveKey (const CKeyID &address) const override
 Check whether a key corresponding to a given address is present in the store. More...
 
std::set< CKeyIDGetKeys () const override
 
bool GetKey (const CKeyID &address, CKey &keyOut) const override
 
bool AddCScript (const CScript &redeemScript) override
 Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki. More...
 
bool HaveCScript (const CScriptID &hash) const override
 
std::set< CScriptIDGetCScripts () const override
 
bool GetCScript (const CScriptID &hash, CScript &redeemScriptOut) const override
 
bool AddWatchOnly (const CScript &dest) override
 Support for Watch-only addresses. More...
 
bool RemoveWatchOnly (const CScript &dest) override
 
bool HaveWatchOnly (const CScript &dest) const override
 
bool HaveWatchOnly () const override
 
- Public Member Functions inherited from SigningProvider
virtual ~SigningProvider ()
 
virtual bool GetKeyOrigin (const CKeyID &keyid, KeyOriginInfo &info) const
 

Protected Types

using KeyMap = std::map< CKeyID, CKey >
 
using WatchKeyMap = std::map< CKeyID, CPubKey >
 
using ScriptMap = std::map< CScriptID, CScript >
 
using WatchOnlySet = std::set< CScript >
 

Protected Member Functions

KeyMap mapKeys GUARDED_BY (cs_KeyStore)
 
WatchKeyMap mapWatchKeys GUARDED_BY (cs_KeyStore)
 
ScriptMap mapScripts GUARDED_BY (cs_KeyStore)
 
WatchOnlySet setWatchOnly GUARDED_BY (cs_KeyStore)
 
void ImplicitlyLearnRelatedKeyScripts (const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
 

Protected Attributes

CCriticalSection cs_KeyStore
 

Detailed Description

Basic key store, that keeps keys in an address->secret map.

Definition at line 42 of file keystore.h.

Member Typedef Documentation

◆ KeyMap

using CBasicKeyStore::KeyMap = std::map<CKeyID, CKey>
protected

Definition at line 47 of file keystore.h.

◆ ScriptMap

using CBasicKeyStore::ScriptMap = std::map<CScriptID, CScript>
protected

Definition at line 49 of file keystore.h.

◆ WatchKeyMap

using CBasicKeyStore::WatchKeyMap = std::map<CKeyID, CPubKey>
protected

Definition at line 48 of file keystore.h.

◆ WatchOnlySet

using CBasicKeyStore::WatchOnlySet = std::set<CScript>
protected

Definition at line 50 of file keystore.h.

Member Function Documentation

◆ AddCScript()

bool CBasicKeyStore::AddCScript ( const CScript redeemScript)
overridevirtual

Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 86 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddKey()

bool CBasicKeyStore::AddKey ( const CKey key)
inline

Definition at line 61 of file keystore.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddKeyPubKey()

bool CBasicKeyStore::AddKeyPubKey ( const CKey key,
const CPubKey pubkey 
)
overridevirtual

Add a key to the store.

Implements CKeyStore.

Reimplemented in CWallet, and CCryptoKeyStore.

Definition at line 51 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddWatchOnly()

bool CBasicKeyStore::AddWatchOnly ( const CScript dest)
overridevirtual

Support for Watch-only addresses.

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 140 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCScript()

bool CBasicKeyStore::GetCScript ( const CScriptID hash,
CScript redeemScriptOut 
) const
overridevirtual

Reimplemented from SigningProvider.

Definition at line 112 of file keystore.cpp.

Here is the caller graph for this function:

◆ GetCScripts()

std::set< CScriptID > CBasicKeyStore::GetCScripts ( ) const
overridevirtual

Implements CKeyStore.

Definition at line 102 of file keystore.cpp.

Here is the caller graph for this function:

◆ GetKey()

bool CBasicKeyStore::GetKey ( const CKeyID address,
CKey keyOut 
) const
overridevirtual

Reimplemented from SigningProvider.

Reimplemented in CCryptoKeyStore.

Definition at line 75 of file keystore.cpp.

Here is the caller graph for this function:

◆ GetKeys()

std::set< CKeyID > CBasicKeyStore::GetKeys ( ) const
overridevirtual

Implements CKeyStore.

Reimplemented in CCryptoKeyStore.

Definition at line 65 of file keystore.cpp.

Here is the caller graph for this function:

◆ GetPubKey()

bool CBasicKeyStore::GetPubKey ( const CKeyID address,
CPubKey vchPubKeyOut 
) const
overridevirtual

Reimplemented from SigningProvider.

Reimplemented in CCryptoKeyStore.

Definition at line 35 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GUARDED_BY() [1/4]

KeyMap mapKeys CBasicKeyStore::GUARDED_BY ( cs_KeyStore  )
protected

◆ GUARDED_BY() [2/4]

WatchKeyMap mapWatchKeys CBasicKeyStore::GUARDED_BY ( cs_KeyStore  )
protected

◆ GUARDED_BY() [3/4]

ScriptMap mapScripts CBasicKeyStore::GUARDED_BY ( cs_KeyStore  )
protected

◆ GUARDED_BY() [4/4]

WatchOnlySet setWatchOnly CBasicKeyStore::GUARDED_BY ( cs_KeyStore  )
protected

◆ HaveCScript()

bool CBasicKeyStore::HaveCScript ( const CScriptID hash) const
overridevirtual

Implements CKeyStore.

Definition at line 96 of file keystore.cpp.

Here is the caller graph for this function:

◆ HaveKey()

bool CBasicKeyStore::HaveKey ( const CKeyID address) const
overridevirtual

Check whether a key corresponding to a given address is present in the store.

Implements CKeyStore.

Reimplemented in CCryptoKeyStore.

Definition at line 59 of file keystore.cpp.

Here is the caller graph for this function:

◆ HaveWatchOnly() [1/2]

bool CBasicKeyStore::HaveWatchOnly ( const CScript dest) const
overridevirtual

Implements CKeyStore.

Definition at line 165 of file keystore.cpp.

Here is the caller graph for this function:

◆ HaveWatchOnly() [2/2]

bool CBasicKeyStore::HaveWatchOnly ( ) const
overridevirtual

Implements CKeyStore.

Definition at line 171 of file keystore.cpp.

◆ ImplicitlyLearnRelatedKeyScripts()

void CBasicKeyStore::ImplicitlyLearnRelatedKeyScripts ( const CPubKey pubkey)
protected

Definition at line 10 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveWatchOnly()

bool CBasicKeyStore::RemoveWatchOnly ( const CScript dest)
overridevirtual

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 152 of file keystore.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cs_KeyStore

CCriticalSection CBasicKeyStore::cs_KeyStore
mutableprotected

Definition at line 45 of file keystore.h.


The documentation for this class was generated from the following files: