14template<
typename M, 
typename K, 
typename V>
 
   17    auto it = map.find(key);
 
   18    if (it != map.end()) {
 
   56    std::pair<CPubKey, KeyOriginInfo> out;
 
   58    if (ret) info = std::move(out.second);
 
   79    for (
const auto& [output_key, spenddata] : b.
tr_spenddata) {
 
  104        mapScripts[
id] = std::move(script);
 
  111    if (!
GetKey(address, key)) {
 
  121    mapKeys[pubkey.
GetID()] = key;
 
  129    return mapKeys.count(address) > 0;
 
  135    std::set<CKeyID> set_address;
 
  136    for (
const auto& mi : mapKeys) {
 
  137        set_address.insert(mi.first);
 
  145    KeyMap::const_iterator mi = mapKeys.find(address);
 
  146    if (mi != mapKeys.end()) {
 
  159    mapScripts[
CScriptID(redeemScript)] = redeemScript;
 
  166    return mapScripts.count(hash) > 0;
 
  172    std::set<CScriptID> set_script;
 
  173    for (
const auto& mi : mapScripts) {
 
  174        set_script.insert(mi.first);
 
  182    ScriptMap::const_iterator mi = mapScripts.find(hash);
 
  183    if (mi != mapScripts.end())
 
  185        redeemScriptOut = (*mi).second;
 
  195    if (
auto id = std::get_if<PKHash>(&dest)) {
 
  198    if (
auto witness_id = std::get_if<WitnessV0KeyHash>(&dest)) {
 
  201    if (
auto script_hash = std::get_if<ScriptHash>(&dest)) {
 
  206            if (
auto inner_witness_id = std::get_if<WitnessV0KeyHash>(&inner_dest)) {
 
  207                return ToKeyID(*inner_witness_id);
 
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.
An encapsulated public key.
bool IsCompressed() const
Check whether this is a compressed public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
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)
void ImplicitlyLearnRelatedKeyScripts(const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
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 GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) 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 GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) 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
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).
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
CKeyID ToKeyID(const PKHash &key_hash)
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > 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< XOnlyPubKey, TaprootSpendData > tr_spenddata
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
Map from output key to spend data.
bool GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) const override
bool error(const char *fmt, const Args &... args)