6 #ifndef BITCOIN_KEYSTORE_H
7 #define BITCOIN_KEYSTORE_H
15 #include <boost/signals2/signal.hpp>
16 #include <boost/variant.hpp>
34 virtual void GetKeys(std::set<CKeyID> &setAddress)
const =0;
49 typedef std::map<CKeyID, CKey>
KeyMap;
71 result = (
mapKeys.count(address) > 0);
75 void GetKeys(std::set<CKeyID> &setAddress)
const
80 KeyMap::const_iterator mi =
mapKeys.begin();
83 setAddress.insert((*mi).first);
92 KeyMap::const_iterator mi =
mapKeys.find(address);
112 typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > >
CryptedKeyMap;
Basic key store, that keeps keys in an address->secret map.
virtual bool RemoveWatchOnly(const CScript &dest)
virtual bool AddWatchOnly(const CScript &dest)
Support for Watch-only addresses.
void GetKeys(std::set< CKeyID > &setAddress) const
virtual bool HaveCScript(const CScriptID &hash) const
virtual bool AddCScript(const CScript &redeemScript)
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
bool GetKey(const CKeyID &address, CKey &keyOut) const
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const
virtual bool HaveWatchOnly() const
WatchOnlySet setWatchOnly
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Add a key to the store.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
Wrapped boost mutex: supports recursive locking, but no waiting TODO: We should move away from using ...
An encapsulated private key.
A reference to a CKey: the Hash160 of its serialized public key.
A virtual base class for key stores.
virtual bool AddKey(const CKey &key)
virtual bool AddWatchOnly(const CScript &dest)=0
Support for Watch-only addresses.
virtual bool HaveWatchOnly(const CScript &dest) const =0
virtual bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const =0
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)=0
Add a key to the store.
virtual bool GetKey(const CKeyID &address, CKey &keyOut) const =0
virtual bool AddCScript(const CScript &redeemScript)=0
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
CCriticalSection cs_KeyStore
virtual bool HaveCScript(const CScriptID &hash) const =0
virtual bool HaveWatchOnly() const =0
virtual bool HaveKey(const CKeyID &address) const =0
Check whether a key corresponding to a given address is present in the store.
virtual void GetKeys(std::set< CKeyID > &setAddress) const =0
virtual bool RemoveWatchOnly(const CScript &dest)=0
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const =0
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization (see script.h)
std::map< CKeyID, CPubKey > WatchKeyMap
std::map< CKeyID, CKey > KeyMap
std::set< CScript > WatchOnlySet
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
std::map< CScriptID, CScript > ScriptMap