Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.h
Show First 20 Lines • Show All 617 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>; | ||||
using CryptedKeyMap = | |||||
std::map<CKeyID, std::pair<CPubKey, std::vector<uint8_t>>>; | |||||
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); | ||||
OutputType m_address_type; | OutputType m_address_type; | ||||
bool m_internal; | bool m_internal; | ||||
KeyMap m_map_keys GUARDED_BY(cs_desc_man); | |||||
CryptedKeyMap m_map_crypted_keys GUARDED_BY(cs_desc_man); | |||||
bool SetCrypted(); | |||||
//! keeps track of whether Unlock has run a thorough check before | |||||
bool m_decryption_thoroughly_checked = false; | |||||
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 49 Lines • ▼ Show 20 Lines | FillPSBT(PartiallySignedTransaction &psbt, | ||||
SigHashType sighash_type = SigHashType().withForkId(), | SigHashType sighash_type = SigHashType().withForkId(), | ||||
bool sign = true, bool bip32derivs = false) const override; | bool sign = true, bool bip32derivs = false) const override; | ||||
uint256 GetID() const override; | uint256 GetID() const override; | ||||
void SetType(OutputType type, bool internal) override; | void SetType(OutputType type, bool internal) override; | ||||
void SetCache(const DescriptorCache &cache); | void SetCache(const DescriptorCache &cache); | ||||
bool AddKey(const CKeyID &key_id, const CKey &key); | |||||
bool AddCryptedKey(const CKeyID &key_id, const CPubKey &pubkey, | |||||
const std::vector<uint8_t> &crypted_key); | |||||
}; | }; | ||||
#endif // BITCOIN_WALLET_SCRIPTPUBKEYMAN_H | #endif // BITCOIN_WALLET_SCRIPTPUBKEYMAN_H |