Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.h
Show First 20 Lines • Show All 624 Lines • ▼ Show 20 Lines | private: | ||||
// 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>; | ||||
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); | ||||
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); | |||||
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 All 10 Lines | bool Encrypt(const CKeyingMaterial &master_key, | ||||
WalletBatch *batch) override; | WalletBatch *batch) override; | ||||
bool GetReservedDestination(const OutputType type, bool internal, | bool GetReservedDestination(const OutputType type, bool internal, | ||||
CTxDestination &address, int64_t &index, | CTxDestination &address, int64_t &index, | ||||
CKeyPool &keypool) override; | CKeyPool &keypool) override; | ||||
void ReturnDestination(int64_t index, bool internal, | void ReturnDestination(int64_t index, bool internal, | ||||
const CTxDestination &addr) override; | const CTxDestination &addr) override; | ||||
// Tops up the descriptor cache and m_map_script_pub_keys. The cache is | |||||
// stored in the wallet file and is used to expand the descriptor in | |||||
// GetNewDestination. DescriptorScriptPubKeyMan relies more on ephemeral | |||||
// data than LegacyScriptPubKeyMan. For wallets using unhardened derivation | |||||
// (with or without private keys), the "keypool" is a single xpub. | |||||
bool TopUp(unsigned int size = 0) override; | bool TopUp(unsigned int size = 0) override; | ||||
void MarkUnusedAddresses(const CScript &script) override; | void MarkUnusedAddresses(const CScript &script) override; | ||||
bool IsHDEnabled() const override; | bool IsHDEnabled() const override; | ||||
//! Setup descriptors based on the given CExtkey | //! Setup descriptors based on the given CExtkey | ||||
bool SetupDescriptorGeneration(const CExtKey &master_key); | bool SetupDescriptorGeneration(const CExtKey &master_key); | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |