6 #ifndef BITCOIN_KEYSTORE_H 7 #define BITCOIN_KEYSTORE_H 16 #include <boost/signals2/signal.hpp> 27 virtual std::set<CKeyID>
GetKeys()
const =0;
47 using KeyMap = std::map<CKeyID, CKey>;
64 std::set<CKeyID>
GetKeys()
const override;
83 #endif // BITCOIN_KEYSTORE_H std::map< CKeyID, CKey > KeyMap
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)=0
Add a key to the store.
CPubKey GetPubKey() const
Compute the public key from a private key.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
CCriticalSection cs_KeyStore
bool HaveCScript(const CScriptID &hash) const override
std::set< CScriptID > GetCScripts() const override
bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
void ImplicitlyLearnRelatedKeyScripts(const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
std::set< CKeyID > GetKeys() const override
bool AddCScript(const CScript &redeemScript) override
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
virtual bool AddWatchOnly(const CScript &dest)=0
Support for Watch-only addresses.
virtual std::set< CScriptID > GetCScripts() const =0
virtual bool AddCScript(const CScript &redeemScript)=0
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
virtual bool HaveCScript(const CScriptID &hash) const =0
bool HaveKey(const CKeyStore &store, const CKey &key)
Checks if a CKey is in the given CKeyStore compressed or otherwise.
boost::variant< CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
std::set< CScript > WatchOnlySet
bool AddKey(const CKey &key)
virtual bool HaveKey(const CKeyID &address) const =0
Check whether a key corresponding to a given address is present in the store.
An encapsulated public key.
virtual bool RemoveWatchOnly(const CScript &dest)=0
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) override
Add a key to the store.
bool GetKey(const CKeyID &address, CKey &keyOut) const override
bool RemoveWatchOnly(const CScript &dest) override
KeyMap mapKeys GUARDED_BY(cs_KeyStore)
#define EXCLUSIVE_LOCKS_REQUIRED(...)
std::map< CScriptID, CScript > ScriptMap
An interface to be implemented by keystores that support signing.
Serialized script, used inside transaction inputs and outputs.
virtual bool HaveWatchOnly() const =0
A virtual base class for key stores.
A reference to a CKey: the Hash360 of its serialized public key.
std::map< CKeyID, CPubKey > WatchKeyMap
A reference to a CScript: the Hash360 of its serialization (see script.h)
CKeyID GetKeyForDestination(const CKeyStore &store, const CTxDestination &dest)
Return the CKeyID of the key involved in a script (if there is a unique one).
An encapsulated private key.
bool HaveWatchOnly() const override
virtual std::set< CKeyID > GetKeys() const =0
bool HaveKey(const CKeyID &address) const override
Check whether a key corresponding to a given address is present in the store.
Basic key store, that keeps keys in an address->secret map.
bool AddWatchOnly(const CScript &dest) override
Support for Watch-only addresses.