diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-07-09 18:23:51 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-04-23 13:59:48 -0400 |
commit | 953feb3d2724f5398dd48990c4957a19313d2c8c (patch) | |
tree | 5111473bc3650d2fc51eb4a7118e090dac6c706d /src/wallet/scriptpubkeyman.cpp | |
parent | 2363e9fcaa41b68bf11153f591b95f2d41ff9a1a (diff) | |
download | bitcoin-953feb3d2724f5398dd48990c4957a19313d2c8c.tar.xz |
Implement loading of keys for DescriptorScriptPubKeyMan
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 7142867081..d651816e58 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<unsigned char>& 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; +} |