15template <
typename M,
typename K,
typename V>
17 auto it =
map.find(key);
18 if (it !=
map.end()) {
26 CScript &script)
const {
51 CScript &script)
const {
60 std::pair<CPubKey, KeyOriginInfo> out;
63 info = std::move(out.second);
75 ret.scripts.insert(
b.scripts.begin(),
b.scripts.end());
76 ret.pubkeys =
a.pubkeys;
77 ret.pubkeys.insert(
b.pubkeys.begin(),
b.pubkeys.end());
79 ret.keys.insert(
b.keys.begin(),
b.keys.end());
80 ret.origins =
a.origins;
81 ret.origins.insert(
b.origins.begin(),
b.origins.end());
88 if (!
GetKey(address, key)) {
104 return mapKeys.count(address) > 0;
119 KeyMap::const_iterator
mi =
mapKeys.find(address);
130 "FillableSigningProvider::AddCScript(): redeemScripts > %i bytes "
168 if (
auto id = std::get_if<PKHash>(&dest)) {
An encapsulated secp256k1 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.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
A reference to a CScript: the Hash160 of its serialization (see script.h)
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
virtual bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
virtual bool GetKey(const CKeyID &address, CKey &keyOut) const override
virtual bool AddCScript(const CScript &redeemScript)
virtual std::set< CKeyID > GetKeys() const
virtual std::set< CScriptID > GetCScripts() const
virtual bool HaveCScript(const CScriptID &hash) const override
RecursiveMutex cs_KeyStore
virtual bool HaveKey(const CKeyID &address) const override
bool GetKey(const CKeyID &keyid, CKey &key) const override
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
const SigningProvider * m_provider
bool GetPubKey(const CKeyID &keyid, CPubKey &pubkey) const override
bool GetCScript(const CScriptID &scriptid, CScript &script) const override
An interface to be implemented by keystores that support signing.
virtual bool GetCScript(const CScriptID &scriptid, CScript &script) const
virtual bool GetPubKey(const CKeyID &address, CPubKey &pubkey) const
virtual bool GetKey(const CKeyID &address, CKey &key) const
virtual bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const
bool error(const char *fmt, const Args &...args)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE
const SigningProvider & DUMMY_SIGNING_PROVIDER
FlatSigningProvider Merge(const FlatSigningProvider &a, const FlatSigningProvider &b)
bool LookupHelper(const M &map, const K &key, V &value)
CKeyID GetKeyForDestination(const SigningProvider &store, const CTxDestination &dest)
Return the CKeyID of the key involved in a script (if there is a unique one).
CKeyID ToKeyID(const PKHash &key_hash)
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
bool GetPubKey(const CKeyID &keyid, CPubKey &pubkey) const override
std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo > > origins
bool GetKey(const CKeyID &keyid, CKey &key) const override
std::map< CKeyID, CPubKey > pubkeys
std::map< CKeyID, CKey > keys
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
std::map< CScriptID, CScript > scripts
bool GetCScript(const CScriptID &scriptid, CScript &script) const override