12 #include <boost/foreach.hpp>
21 if (!
GetKey(address, key)) {
23 WatchKeyMap::const_iterator it =
mapWatchKeys.find(address);
25 vchPubKeyOut = it->second;
43 if (redeemScript.
size() > MAX_SCRIPT_ELEMENT_SIZE)
44 return error(
"CBasicKeyStore::AddCScript(): redeemScripts > %i bytes are invalid", MAX_SCRIPT_ELEMENT_SIZE);
60 ScriptMap::const_iterator mi =
mapScripts.find(hash);
63 redeemScriptOut = (*mi).second;
74 std::vector<unsigned char> vch;
75 if (!dest.
GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65)
90 if (ExtractPubKey(dest, pubKey))
100 if (ExtractPubKey(dest, pubKey))
virtual bool RemoveWatchOnly(const CScript &dest)
virtual bool AddWatchOnly(const CScript &dest)
Support for Watch-only addresses.
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
An encapsulated private key.
CPubKey GetPubKey() const
Compute the public key from a private key.
A reference to a CKey: the Hash160 of its serialized public key.
virtual bool AddKey(const CKey &key)
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)=0
Add a key to the store.
CCriticalSection cs_KeyStore
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
bool IsFullyValid() const
fully validate whether this is a valid public key (more expensive than IsValid())
Serialized script, used inside transaction inputs and outputs.
bool GetOp(iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet)
A reference to a CScript: the Hash160 of its serialization (see script.h)
opcodetype
Script opcodes.
bool error(const char *fmt, const Args &... args)