From 953feb3d2724f5398dd48990c4957a19313d2c8c Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 9 Jul 2019 18:23:51 -0400 Subject: Implement loading of keys for DescriptorScriptPubKeyMan --- src/wallet/scriptpubkeyman.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/wallet/scriptpubkeyman.cpp') diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 714286708..d651816e5 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1653,3 +1653,21 @@ void DescriptorScriptPubKeyMan::SetCache(const DescriptorCache& cache) } } } + +bool DescriptorScriptPubKeyMan::AddKey(const CKeyID& key_id, const CKey& key) +{ + LOCK(cs_desc_man); + m_map_keys[key_id] = key; + return true; +} + +bool DescriptorScriptPubKeyMan::AddCryptedKey(const CKeyID& key_id, const CPubKey& pubkey, const std::vector& crypted_key) +{ + LOCK(cs_desc_man); + if (!m_map_keys.empty()) { + return false; + } + + m_map_crypted_keys[key_id] = make_pair(pubkey, crypted_key); + return true; +} -- cgit v1.2.3