Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

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

#include <keystore.h>

+ Inheritance diagram for CBasicKeyStore:
+ Collaboration diagram for CBasicKeyStore:

Public Member Functions

bool AddKeyPubKey (const CKey &key, const CPubKey &pubkey) override
 Add a key to the store. More...
 
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
 
virtual bool GetHDChain (CHDChain &hdChainRet) const
 
- Public Member Functions inherited from CKeyStore
virtual ~CKeyStore ()
 
virtual bool AddKey (const CKey &key)
 

Protected Attributes

KeyMap mapKeys
 
WatchKeyMap mapWatchKeys
 
ScriptMap mapScripts
 
WatchOnlySet setWatchOnly
 
CHDChain hdChain
 
- Protected Attributes inherited from CKeyStore
CCriticalSection cs_KeyStore
 

Detailed Description

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

Definition at line 56 of file keystore.h.

Member Function Documentation

◆ AddCScript()

bool CBasicKeyStore::AddCScript ( const CScript redeemScript)
overridevirtual

◆ 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 30 of file keystore.cpp.

References CKeyStore::cs_KeyStore, CPubKey::GetID(), LOCK, and mapKeys.

Referenced by CCryptoKeyStore::AddKeyPubKey().

◆ AddWatchOnly()

bool CBasicKeyStore::AddWatchOnly ( const CScript dest)
overridevirtual

Support for Watch-only addresses.

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 118 of file keystore.cpp.

References CKeyStore::cs_KeyStore, ExtractPubKey(), CPubKey::GetID(), LOCK, mapWatchKeys, and setWatchOnly.

Referenced by CWallet::AddWatchOnly(), and CWallet::LoadWatchOnly().

◆ GetCScript()

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

Implements CKeyStore.

Definition at line 90 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapScripts.

Referenced by dumpwallet(), and listunspent().

◆ GetCScripts()

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

Implements CKeyStore.

Definition at line 80 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapScripts.

Referenced by dumpwallet().

◆ GetHDChain()

bool CBasicKeyStore::GetHDChain ( CHDChain hdChainRet) const
virtual

Reimplemented in CCryptoKeyStore.

Definition at line 150 of file keystore.cpp.

References hdChain, and CHDChain::IsNull().

◆ GetKey()

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

Implements CKeyStore.

Reimplemented in CWallet, and CCryptoKeyStore.

Definition at line 53 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapKeys.

Referenced by CCryptoKeyStore::GetKey(), and GetPubKey().

◆ GetKeys()

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

Implements CKeyStore.

Reimplemented in CCryptoKeyStore.

Definition at line 43 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapKeys.

Referenced by CCryptoKeyStore::GetKeys().

◆ GetPubKey()

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

Implements CKeyStore.

Reimplemented in CWallet, and CCryptoKeyStore.

Definition at line 14 of file keystore.cpp.

References CKeyStore::cs_KeyStore, GetKey(), CKey::GetPubKey(), LOCK, and mapWatchKeys.

Referenced by CCryptoKeyStore::GetPubKey().

◆ HaveCScript()

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

Implements CKeyStore.

Definition at line 74 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapScripts.

Referenced by CheckWalletOwnsScript(), ImportScript(), importwallet(), and ProcessImport().

◆ 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 CWallet, and CCryptoKeyStore.

Definition at line 37 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and mapKeys.

Referenced by CCryptoKeyStore::HaveKey().

◆ HaveWatchOnly() [1/2]

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

Implements CKeyStore.

Definition at line 138 of file keystore.cpp.

References CKeyStore::cs_KeyStore, LOCK, and setWatchOnly.

Referenced by ImportScript(), and WalletModel::WalletModel().

◆ HaveWatchOnly() [2/2]

bool CBasicKeyStore::HaveWatchOnly ( ) const
overridevirtual

◆ RemoveWatchOnly()

bool CBasicKeyStore::RemoveWatchOnly ( const CScript dest)
overridevirtual

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 128 of file keystore.cpp.

References CKeyStore::cs_KeyStore, ExtractPubKey(), CPubKey::GetID(), LOCK, mapWatchKeys, and setWatchOnly.

Referenced by CWallet::RemoveWatchOnly().

Member Data Documentation

◆ hdChain

CHDChain CBasicKeyStore::hdChain
protected

◆ mapKeys

KeyMap CBasicKeyStore::mapKeys
protected

◆ mapScripts

ScriptMap CBasicKeyStore::mapScripts
protected

Definition at line 61 of file keystore.h.

Referenced by AddCScript(), GetCScript(), GetCScripts(), HaveCScript(), and CWallet::LoadWallet().

◆ mapWatchKeys

WatchKeyMap CBasicKeyStore::mapWatchKeys
protected

Definition at line 60 of file keystore.h.

Referenced by AddWatchOnly(), GetPubKey(), CWallet::LoadWallet(), and RemoveWatchOnly().

◆ setWatchOnly

WatchOnlySet CBasicKeyStore::setWatchOnly
protected

Definition at line 62 of file keystore.h.

Referenced by AddWatchOnly(), HaveWatchOnly(), CWallet::LoadWallet(), and RemoveWatchOnly().


The documentation for this class was generated from the following files:
Released under the MIT license