| 804 | } |
| 805 | |
| 806 | bool LegacyScriptPubKeyMan::AddKeyPubKeyInner(const CKey& key, const CPubKey &pubkey) |
| 807 | { |
| 808 | LOCK(cs_KeyStore); |
| 809 | if (!m_storage.HasEncryptionKeys()) { |
| 810 | return FillableSigningProvider::AddKeyPubKey(key, pubkey); |
| 811 | } |
| 812 | |
| 813 | if (m_storage.IsLocked()) { |
| 814 | return false; |
| 815 | } |
| 816 | |
| 817 | std::vector<unsigned char> vchCryptedSecret; |
| 818 | CKeyingMaterial vchSecret(key.begin(), key.end()); |
| 819 | if (!EncryptSecret(m_storage.GetEncryptionKey(), vchSecret, pubkey.GetHash(), vchCryptedSecret)) { |
| 820 | return false; |
| 821 | } |
| 822 | |
| 823 | if (!AddCryptedKey(pubkey, vchCryptedSecret)) { |
| 824 | return false; |
| 825 | } |
| 826 | return true; |
| 827 | } |
| 828 | |
| 829 | bool LegacyScriptPubKeyMan::LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret, bool checksum_valid) |
| 830 | { |
nothing calls this directly
no test coverage detected