From 78f8a92910d34247fa5d04368338c598d9908267 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 16 Jul 2019 13:50:32 -0400 Subject: [PATCH] Implement SetType in DescriptorScriptPubKeyMan --- src/wallet/scriptpubkeyman.cpp | 6 +++++- src/wallet/scriptpubkeyman.h | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index ea61ab793e8..c825438f997 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1608,4 +1608,8 @@ uint256 DescriptorScriptPubKeyMan::GetID() const return uint256(); } -void DescriptorScriptPubKeyMan::SetType(OutputType type, bool internal) {} +void DescriptorScriptPubKeyMan::SetType(OutputType type, bool internal) +{ + this->m_address_type = type; + this->m_internal = internal; +} diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 3e9db905fd9..81c89de9851 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -490,11 +490,18 @@ private: using ScriptPubKeyMap = std::map; // Map of scripts to descriptor range index ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man); + + OutputType m_address_type; + bool m_internal; public: DescriptorScriptPubKeyMan(WalletStorage& storage, WalletDescriptor& descriptor) : ScriptPubKeyMan(storage), m_wallet_descriptor(descriptor) {} + DescriptorScriptPubKeyMan(WalletStorage& storage, OutputType address_type, bool internal) + : ScriptPubKeyMan(storage), + m_address_type(address_type), m_internal(internal) + {} mutable RecursiveMutex cs_desc_man;