Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.h
Show First 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
class DescriptorScriptPubKeyMan : public ScriptPubKeyMan { | class DescriptorScriptPubKeyMan : public ScriptPubKeyMan { | ||||
private: | private: | ||||
WalletDescriptor m_wallet_descriptor GUARDED_BY(cs_desc_man); | WalletDescriptor m_wallet_descriptor GUARDED_BY(cs_desc_man); | ||||
// Map of scripts to descriptor range index | // Map of scripts to descriptor range index | ||||
using ScriptPubKeyMap = std::map<CScript, int32_t>; | using ScriptPubKeyMap = std::map<CScript, int32_t>; | ||||
// Map of pubkeys involved in scripts to descriptor range index | |||||
using PubKeyMap = std::map<CPubKey, int32_t>; | |||||
using CryptedKeyMap = | using CryptedKeyMap = | ||||
std::map<CKeyID, std::pair<CPubKey, std::vector<uint8_t>>>; | std::map<CKeyID, std::pair<CPubKey, std::vector<uint8_t>>>; | ||||
using KeyMap = std::map<CKeyID, CKey>; | using KeyMap = std::map<CKeyID, CKey>; | ||||
ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man); | ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man); | ||||
PubKeyMap m_map_pubkeys GUARDED_BY(cs_desc_man); | |||||
int32_t m_max_cached_index = -1; | int32_t m_max_cached_index = -1; | ||||
OutputType m_address_type; | OutputType m_address_type; | ||||
bool m_internal; | bool m_internal; | ||||
KeyMap m_map_keys GUARDED_BY(cs_desc_man); | KeyMap m_map_keys GUARDED_BY(cs_desc_man); | ||||
CryptedKeyMap m_map_crypted_keys GUARDED_BY(cs_desc_man); | CryptedKeyMap m_map_crypted_keys GUARDED_BY(cs_desc_man); | ||||
bool SetCrypted(); | bool SetCrypted(); | ||||
//! keeps track of whether Unlock has run a thorough check before | //! keeps track of whether Unlock has run a thorough check before | ||||
bool m_decryption_thoroughly_checked = false; | bool m_decryption_thoroughly_checked = false; | ||||
bool AddDescriptorKeyWithDB(WalletBatch &batch, const CKey &key, | bool AddDescriptorKeyWithDB(WalletBatch &batch, const CKey &key, | ||||
const CPubKey &pubkey); | const CPubKey &pubkey); | ||||
KeyMap GetKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man); | KeyMap GetKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man); | ||||
// Fetch the SigningProvider for the given script and optionally include | |||||
// private keys | |||||
std::unique_ptr<FlatSigningProvider> | |||||
GetSigningProvider(const CScript &script, | |||||
bool include_private = false) const; | |||||
// Fetch the SigningProvider for the given pubkey and always include private | |||||
// keys. This should only be called by signing code. | |||||
std::unique_ptr<FlatSigningProvider> | |||||
GetSigningProvider(const CPubKey &pubkey) const; | |||||
// Fetch the SigningProvider for a given index and optionally include | |||||
// private keys. Called by the above functions. | |||||
std::unique_ptr<FlatSigningProvider> | |||||
GetSigningProvider(int32_t index, bool include_private = false) const | |||||
EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man); | |||||
public: | public: | ||||
DescriptorScriptPubKeyMan(WalletStorage &storage, | DescriptorScriptPubKeyMan(WalletStorage &storage, | ||||
WalletDescriptor &descriptor) | WalletDescriptor &descriptor) | ||||
: ScriptPubKeyMan(storage), m_wallet_descriptor(descriptor) {} | : ScriptPubKeyMan(storage), m_wallet_descriptor(descriptor) {} | ||||
DescriptorScriptPubKeyMan(WalletStorage &storage, OutputType address_type, | DescriptorScriptPubKeyMan(WalletStorage &storage, OutputType address_type, | ||||
bool internal) | bool internal) | ||||
: ScriptPubKeyMan(storage), m_address_type(address_type), | : ScriptPubKeyMan(storage), m_address_type(address_type), | ||||
m_internal(internal) {} | m_internal(internal) {} | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |